Skip to content

Commit 9a5f65f

Browse files
authored
docs(updating): show how to migrate custom step color usages (#3496)
1 parent 9914e50 commit 9a5f65f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/updating/8-0.md

+28
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,34 @@ While migrating to include the new dark theme files is unlikely to cause breakin
108108

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

111+
### Step Color Tokens
112+
113+
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.
114+
115+
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.
116+
117+
`--ion-color-step-[number]` usages for **background color** can be migrated by renaming the token to `--ion-background-color-step-[number]`.
118+
119+
**Example**:
120+
121+
```diff
122+
button {
123+
- background: var(--ion-color-step-400);
124+
+ background: var(--ion-background-color-step-400);
125+
}
126+
```
127+
128+
`--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.
129+
130+
**Example**:
131+
132+
```diff
133+
button {
134+
- color: var(--ion-color-step-400);
135+
+ color: var(--ion-text-color-step-600); /* 1000 - 400 = 600 */
136+
}
137+
```
138+
111139
### Dynamic Font
112140

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

0 commit comments

Comments
 (0)