Skip to content

docs(updating): show how to migrate custom step color usages #3496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/updating/8-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,34 @@ While migrating to include the new dark theme files is unlikely to cause breakin

For more information on the new dark theme files, refer to the [Dark Mode documentation](../theming/dark-mode).

### Step Color Tokens

To better support the high contrast theme in Ionic 8, separate step colors tokens have been introduced for text and background color. Previously both text and background color were controlled by a single set of `--ion-color-step-[number]` tokens.

Using the newly imported dark theme mentioned above will also import these new step color tokens. However, developers will need to update any step color tokens that were manually defined in an application.

`--ion-color-step-[number]` usages for **background color** can be migrated by renaming the token to `--ion-background-color-step-[number]`.

**Example**:

```diff
button {
- background: var(--ion-color-step-400);
+ background: var(--ion-background-color-step-400);
}
```

`--ion-color-step-[number]` usages for **text color** can be migrated by renaming the token to `--ion-text-color-step-[number]` and subtracting the number from 1000.

**Example**:

```diff
button {
- color: var(--ion-color-step-400);
+ color: var(--ion-text-color-step-600); /* 1000 - 400 = 600 */
}
```

### Dynamic Font

The `core.css` file has been updated to enable dynamic font scaling by default.
Expand Down