Skip to content

Commit e71b55f

Browse files
committed
Theme: Add disabled variants for brand and error interactive color tokens
Add `disabled` variants for the `brand` and `error` tones across the interactive `bg`, `fg`, and `stroke` color tokens, mirroring the existing tone-agnostic `neutral` disabled tokens. This brings brand/error to parity with neutral (T-M5).
1 parent 58322cc commit e71b55f

8 files changed

Lines changed: 138 additions & 2 deletions

File tree

packages/theme/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Add `--wpds-border-radius-xl` for page and app shell surfaces so nested cards and notices can stay on `--wpds-border-radius-lg` without matching the parent radius ([#78913](https://github.com/WordPress/gutenberg/pull/78913)).
88
- Add `cornerRadius` prop to `ThemeProvider` for configuring the border-radius preset (`none`, `subtle`, `moderate`, `pronounced`) via prebuilt design token modes. [#78816](https://github.com/WordPress/gutenberg/pull/78816).
9+
- Add disabled variants for the `brand` and `error` tones of the interactive `background`, `foreground`, and `stroke` color tokens (e.g. `--wpds-color-stroke-interactive-brand-disabled`, `--wpds-color-background-interactive-brand-strong-disabled`), for parity with the existing `neutral` disabled tokens.
910

1011
### Breaking Changes
1112

packages/theme/docs/tokens.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,19 @@ The interactive state of the element. The default (no modifier) is the idle stat
164164
| `--wpds-color-background-interactive-neutral-weak-disabled` | Background color for interactive elements with weak emphasis, in their disabled state, regardless of the tone. |
165165
| `--wpds-color-background-interactive-brand-strong` | Background color for interactive elements with brand tone and strong emphasis. |
166166
| `--wpds-color-background-interactive-brand-strong-active` | Background color for interactive elements with brand tone and strong emphasis that are hovered, focused, or active. |
167+
| `--wpds-color-background-interactive-brand-strong-disabled` | Background color for interactive elements with strong emphasis, in their disabled state, regardless of the tone. |
167168
| `--wpds-color-background-interactive-brand-weak` | Background color for interactive elements with brand tone and weak emphasis. |
168169
| `--wpds-color-background-interactive-brand-weak-active` | Background color for interactive elements with brand tone and weak emphasis that are hovered, focused, or active. |
170+
| `--wpds-color-background-interactive-brand-weak-disabled` | Background color for interactive elements with weak emphasis, in their disabled state, regardless of the tone. |
169171
| `--wpds-color-background-interactive-error` | Background color for interactive elements with error tone and normal emphasis. |
170172
| `--wpds-color-background-interactive-error-active` | Background color for interactive elements with error tone and normal emphasis that are hovered, focused, or active. |
173+
| `--wpds-color-background-interactive-error-disabled` | Background color for interactive elements with normal emphasis, in their disabled state, regardless of the tone. |
171174
| `--wpds-color-background-interactive-error-strong` | Background color for interactive elements with error tone and strong emphasis. |
172175
| `--wpds-color-background-interactive-error-strong-active` | Background color for interactive elements with error tone and strong emphasis that are hovered, focused, or active. |
176+
| `--wpds-color-background-interactive-error-strong-disabled` | Background color for interactive elements with strong emphasis, in their disabled state, regardless of the tone. |
173177
| `--wpds-color-background-interactive-error-weak` | Background color for interactive elements with error tone and weak emphasis. |
174178
| `--wpds-color-background-interactive-error-weak-active` | Background color for interactive elements with error tone and weak emphasis that are hovered, focused, or active. |
179+
| `--wpds-color-background-interactive-error-weak-disabled` | Background color for interactive elements with weak emphasis, in their disabled state, regardless of the tone. |
175180
| `--wpds-color-background-track-neutral-weak` | Background color for tracks with a neutral tone and weak emphasis (eg. scrollbar track). |
176181
| `--wpds-color-background-track-neutral` | Background color for tracks with a neutral tone and normal emphasis (eg. slider or progressbar track). |
177182
| `--wpds-color-background-thumb-neutral-weak` | Background color for thumbs with a neutral tone and weak emphasis (eg. scrollbar thumb). |
@@ -201,12 +206,16 @@ The interactive state of the element. The default (no modifier) is the idle stat
201206
| `--wpds-color-foreground-interactive-neutral-weak-disabled` | Foreground color for interactive elements with weak emphasis, in their disabled state, regardless of the tone. |
202207
| `--wpds-color-foreground-interactive-brand` | Foreground color for interactive elements with brand tone and normal emphasis. |
203208
| `--wpds-color-foreground-interactive-brand-active` | Foreground color for interactive elements with brand tone and normal emphasis that are hovered, focused, or active. |
209+
| `--wpds-color-foreground-interactive-brand-disabled` | Foreground color for interactive elements with normal emphasis, in their disabled state, regardless of the tone. |
204210
| `--wpds-color-foreground-interactive-brand-strong` | Foreground color for interactive elements with brand tone and strong emphasis. |
205211
| `--wpds-color-foreground-interactive-brand-strong-active` | Foreground color for interactive elements with brand tone and strong emphasis that are hovered, focused, or active. |
212+
| `--wpds-color-foreground-interactive-brand-strong-disabled` | Foreground color for interactive elements with strong emphasis, in their disabled state, regardless of the tone. |
206213
| `--wpds-color-foreground-interactive-error` | Foreground color for interactive elements with error tone and normal emphasis. |
207214
| `--wpds-color-foreground-interactive-error-active` | Foreground color for interactive elements with error tone and normal emphasis that are hovered, focused, or active. |
215+
| `--wpds-color-foreground-interactive-error-disabled` | Foreground color for interactive elements with normal emphasis, in their disabled state, regardless of the tone. |
208216
| `--wpds-color-foreground-interactive-error-strong` | Foreground color for interactive elements with error tone and strong emphasis. |
209217
| `--wpds-color-foreground-interactive-error-strong-active` | Foreground color for interactive elements with error tone and strong emphasis that are hovered, focused, or active. |
218+
| `--wpds-color-foreground-interactive-error-strong-disabled` | Foreground color for interactive elements with strong emphasis, in their disabled state, regardless of the tone. |
210219
| `--wpds-color-stroke-surface-neutral` | Decorative stroke color used to define neutrally-toned surface boundaries with normal emphasis. |
211220
| `--wpds-color-stroke-surface-neutral-weak` | Decorative stroke color used to define neutrally-toned surface boundaries with weak emphasis. |
212221
| `--wpds-color-stroke-surface-neutral-strong` | Decorative stroke color used to define neutrally-toned surface boundaries with strong emphasis. |
@@ -226,9 +235,12 @@ The interactive state of the element. The default (no modifier) is the idle stat
226235
| `--wpds-color-stroke-interactive-neutral-strong` | Accessible stroke color used for interactive neutrally-toned elements with strong emphasis. |
227236
| `--wpds-color-stroke-interactive-brand` | Accessible stroke color used for interactive brand-toned elements with normal emphasis. |
228237
| `--wpds-color-stroke-interactive-brand-active` | Accessible stroke color used for interactive brand-toned elements with normal emphasis that are hovered, focused, or active. |
238+
| `--wpds-color-stroke-interactive-brand-disabled` | Accessible stroke color used for interactive elements with normal emphasis, in their disabled state, regardless of the tone. |
229239
| `--wpds-color-stroke-interactive-error` | Accessible stroke color used for interactive error-toned elements with normal emphasis. |
230240
| `--wpds-color-stroke-interactive-error-active` | Accessible stroke color used for interactive error-toned elements with normal emphasis that are hovered, focused, or active. |
241+
| `--wpds-color-stroke-interactive-error-disabled` | Accessible stroke color used for interactive elements with normal emphasis, in their disabled state, regardless of the tone. |
231242
| `--wpds-color-stroke-interactive-error-strong` | Accessible stroke color used for interactive error-toned elements with strong emphasis. |
243+
| `--wpds-color-stroke-interactive-error-strong-disabled` | Accessible stroke color used for interactive elements with normal emphasis, in their disabled state, regardless of the tone. |
232244
| `--wpds-color-stroke-focus` | Accessible stroke color applied to focus rings. |
233245

234246
### Cursor

packages/theme/src/prebuilt/css/design-tokens.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,32 @@
6767
--wpds-color-background-interactive-brand-strong: #3858e9;
6868
/* Background color for interactive elements with brand tone and strong emphasis that are hovered, focused, or active. */
6969
--wpds-color-background-interactive-brand-strong-active: #2e49d9;
70+
/* Background color for interactive elements with strong emphasis, in their disabled state, regardless of the tone. */
71+
--wpds-color-background-interactive-brand-strong-disabled: #e6e6e6;
7072
/* Background color for interactive elements with brand tone and weak emphasis. */
7173
--wpds-color-background-interactive-brand-weak: #0000;
7274
/* Background color for interactive elements with brand tone and weak emphasis that are hovered, focused, or active. */
7375
--wpds-color-background-interactive-brand-weak-active: #e6eaf4;
76+
/* Background color for interactive elements with weak emphasis, in their disabled state, regardless of the tone. */
77+
--wpds-color-background-interactive-brand-weak-disabled: #0000;
7478
/* Background color for interactive elements with error tone and normal emphasis. */
7579
--wpds-color-background-interactive-error: #0000;
7680
/* Background color for interactive elements with error tone and normal emphasis that are hovered, focused, or active. */
7781
--wpds-color-background-interactive-error-active: #fff6f5;
82+
/* Background color for interactive elements with normal emphasis, in their disabled state, regardless of the tone. */
83+
--wpds-color-background-interactive-error-disabled: #0000;
7884
/* Background color for interactive elements with error tone and strong emphasis. */
7985
--wpds-color-background-interactive-error-strong: #cc1818;
8086
/* Background color for interactive elements with error tone and strong emphasis that are hovered, focused, or active. */
8187
--wpds-color-background-interactive-error-strong-active: #b90000;
88+
/* Background color for interactive elements with strong emphasis, in their disabled state, regardless of the tone. */
89+
--wpds-color-background-interactive-error-strong-disabled: #e6e6e6;
8290
/* Background color for interactive elements with error tone and weak emphasis. */
8391
--wpds-color-background-interactive-error-weak: #0000;
8492
/* Background color for interactive elements with error tone and weak emphasis that are hovered, focused, or active. */
8593
--wpds-color-background-interactive-error-weak-active: #f6e6e3;
94+
/* Background color for interactive elements with weak emphasis, in their disabled state, regardless of the tone. */
95+
--wpds-color-background-interactive-error-weak-disabled: #0000;
8696
/* Background color for tracks with a neutral tone and weak emphasis (eg. scrollbar track). */
8797
--wpds-color-background-track-neutral-weak: #f0f0f0;
8898
/* Background color for tracks with a neutral tone and normal emphasis (eg. slider or progressbar track). */
@@ -141,18 +151,26 @@
141151
--wpds-color-foreground-interactive-brand: #3858e9;
142152
/* Foreground color for interactive elements with brand tone and normal emphasis that are hovered, focused, or active. */
143153
--wpds-color-foreground-interactive-brand-active: #3858e9;
154+
/* Foreground color for interactive elements with normal emphasis, in their disabled state, regardless of the tone. */
155+
--wpds-color-foreground-interactive-brand-disabled: #8d8d8d;
144156
/* Foreground color for interactive elements with brand tone and strong emphasis. */
145157
--wpds-color-foreground-interactive-brand-strong: #eff0f2;
146158
/* Foreground color for interactive elements with brand tone and strong emphasis that are hovered, focused, or active. */
147159
--wpds-color-foreground-interactive-brand-strong-active: #eff0f2;
160+
/* Foreground color for interactive elements with strong emphasis, in their disabled state, regardless of the tone. */
161+
--wpds-color-foreground-interactive-brand-strong-disabled: #8d8d8d;
148162
/* Foreground color for interactive elements with error tone and normal emphasis. */
149163
--wpds-color-foreground-interactive-error: #cc1818;
150164
/* Foreground color for interactive elements with error tone and normal emphasis that are hovered, focused, or active. */
151165
--wpds-color-foreground-interactive-error-active: #cc1818;
166+
/* Foreground color for interactive elements with normal emphasis, in their disabled state, regardless of the tone. */
167+
--wpds-color-foreground-interactive-error-disabled: #8d8d8d;
152168
/* Foreground color for interactive elements with error tone and strong emphasis. */
153169
--wpds-color-foreground-interactive-error-strong: #f2efef;
154170
/* Foreground color for interactive elements with error tone and strong emphasis that are hovered, focused, or active. */
155171
--wpds-color-foreground-interactive-error-strong-active: #f2efef;
172+
/* Foreground color for interactive elements with strong emphasis, in their disabled state, regardless of the tone. */
173+
--wpds-color-foreground-interactive-error-strong-disabled: #8d8d8d;
156174
/* Decorative stroke color used to define neutrally-toned surface boundaries with normal emphasis. */
157175
--wpds-color-stroke-surface-neutral: #dbdbdb;
158176
/* Decorative stroke color used to define neutrally-toned surface boundaries with weak emphasis. */
@@ -191,12 +209,18 @@
191209
--wpds-color-stroke-interactive-brand: #3858e9;
192210
/* Accessible stroke color used for interactive brand-toned elements with normal emphasis that are hovered, focused, or active. */
193211
--wpds-color-stroke-interactive-brand-active: #2337c8;
212+
/* Accessible stroke color used for interactive elements with normal emphasis, in their disabled state, regardless of the tone. */
213+
--wpds-color-stroke-interactive-brand-disabled: #dbdbdb;
194214
/* Accessible stroke color used for interactive error-toned elements with normal emphasis. */
195215
--wpds-color-stroke-interactive-error: #cc1818;
196216
/* Accessible stroke color used for interactive error-toned elements with normal emphasis that are hovered, focused, or active. */
197217
--wpds-color-stroke-interactive-error-active: #9d0000;
218+
/* Accessible stroke color used for interactive elements with normal emphasis, in their disabled state, regardless of the tone. */
219+
--wpds-color-stroke-interactive-error-disabled: #dbdbdb;
198220
/* Accessible stroke color used for interactive error-toned elements with strong emphasis. */
199221
--wpds-color-stroke-interactive-error-strong: #cc1818;
222+
/* Accessible stroke color used for interactive elements with normal emphasis, in their disabled state, regardless of the tone. */
223+
--wpds-color-stroke-interactive-error-strong-disabled: #dbdbdb;
200224
/* Accessible stroke color applied to focus rings. */
201225
--wpds-color-stroke-focus: #3858e9;
202226
/* Cursor style for interactive controls that are not links (e.g. buttons, checkboxes, and toggles). */

packages/theme/src/prebuilt/js/design-token-fallbacks.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,20 @@ export default {
1818
'var(--wp-admin-theme-color, #3858e9)',
1919
'--wpds-color-background-interactive-brand-strong-active':
2020
'color-mix(in oklch, var(--wp-admin-theme-color, #3858e9) 93%, black)',
21+
'--wpds-color-background-interactive-brand-strong-disabled': '#e6e6e6',
2122
'--wpds-color-background-interactive-brand-weak': '#0000',
2223
'--wpds-color-background-interactive-brand-weak-active':
2324
'color-mix(in oklch, var(--wp-admin-theme-color, #3858e9) 12%, white)',
25+
'--wpds-color-background-interactive-brand-weak-disabled': '#0000',
2426
'--wpds-color-background-interactive-error': '#0000',
2527
'--wpds-color-background-interactive-error-active': '#fff6f5',
28+
'--wpds-color-background-interactive-error-disabled': '#0000',
2629
'--wpds-color-background-interactive-error-strong': '#cc1818',
2730
'--wpds-color-background-interactive-error-strong-active': '#b90000',
31+
'--wpds-color-background-interactive-error-strong-disabled': '#e6e6e6',
2832
'--wpds-color-background-interactive-error-weak': '#0000',
2933
'--wpds-color-background-interactive-error-weak-active': '#f6e6e3',
34+
'--wpds-color-background-interactive-error-weak-disabled': '#0000',
3035
'--wpds-color-background-interactive-neutral-strong': '#2d2d2d',
3136
'--wpds-color-background-interactive-neutral-strong-active': '#1e1e1e',
3237
'--wpds-color-background-interactive-neutral-strong-disabled': '#e6e6e6',
@@ -73,12 +78,16 @@ export default {
7378
'var(--wp-admin-theme-color, #3858e9)',
7479
'--wpds-color-foreground-interactive-brand-active':
7580
'var(--wp-admin-theme-color, #3858e9)',
81+
'--wpds-color-foreground-interactive-brand-disabled': '#8d8d8d',
7682
'--wpds-color-foreground-interactive-brand-strong': '#fff',
7783
'--wpds-color-foreground-interactive-brand-strong-active': '#fff',
84+
'--wpds-color-foreground-interactive-brand-strong-disabled': '#8d8d8d',
7885
'--wpds-color-foreground-interactive-error': '#cc1818',
7986
'--wpds-color-foreground-interactive-error-active': '#cc1818',
87+
'--wpds-color-foreground-interactive-error-disabled': '#8d8d8d',
8088
'--wpds-color-foreground-interactive-error-strong': '#f2efef',
8189
'--wpds-color-foreground-interactive-error-strong-active': '#f2efef',
90+
'--wpds-color-foreground-interactive-error-strong-disabled': '#8d8d8d',
8291
'--wpds-color-foreground-interactive-neutral': '#1e1e1e',
8392
'--wpds-color-foreground-interactive-neutral-active': '#1e1e1e',
8493
'--wpds-color-foreground-interactive-neutral-disabled': '#8d8d8d',
@@ -92,9 +101,12 @@ export default {
92101
'var(--wp-admin-theme-color, #3858e9)',
93102
'--wpds-color-stroke-interactive-brand-active':
94103
'color-mix(in oklch, var(--wp-admin-theme-color, #3858e9) 85%, black)',
104+
'--wpds-color-stroke-interactive-brand-disabled': '#dbdbdb',
95105
'--wpds-color-stroke-interactive-error': '#cc1818',
96106
'--wpds-color-stroke-interactive-error-active': '#9d0000',
107+
'--wpds-color-stroke-interactive-error-disabled': '#dbdbdb',
97108
'--wpds-color-stroke-interactive-error-strong': '#cc1818',
109+
'--wpds-color-stroke-interactive-error-strong-disabled': '#dbdbdb',
98110
'--wpds-color-stroke-interactive-neutral': '#8d8d8d',
99111
'--wpds-color-stroke-interactive-neutral-active': '#6e6e6e',
100112
'--wpds-color-stroke-interactive-neutral-disabled': '#dbdbdb',

0 commit comments

Comments
 (0)