Skip to content

Commit cd7b4af

Browse files
ciampoaduth
andauthored
Theme: Add disabled variants for brand and error interactive color tokens (#79124)
* 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). * Theme: Make disabled token descriptions tone-specific and adopt them in consumers Now that brand/error tones have their own disabled tokens, reword the disabled `$description`s to be tone-specific (dropping "regardless of the tone" from the neutral ones, which was the shared-disabled rationale). Update the `Button` (brand) and `AlertDialog` (error) disabled states to reference the matching tone-specific disabled tokens instead of reaching into the `neutral` namespace. Values are identical, so there is no visual change. `item-popup` is left on `neutral-disabled`: its disabled color applies to the item text, which is neutral-toned in every state (only the highlight background is brand-toned, and disabled items are never highlighted). * ItemPopup: Use brand disabled background token for disabled items The disabled item background is brand-toned (the highlight uses `brand-weak-active`). Reference `background-interactive-brand-weak-disabled` explicitly so the disabled state stays in sync if the token value ever changes, even though it currently resolves to transparent. The item text remains neutral-toned. * Theme: Drop stroke error-strong-disabled token for neutral parity The neutral stroke tone exposes only a normal-emphasis disabled token (no strong-emphasis disabled variant), so the error tone should match. Removes the unused strong-emphasis disabled stroke token and regenerates the prebuilt artifacts and docs. * UI: Clarify changelog wording for disabled token adoption The disabled list-item background in Select/Autocomplete/Combobox is a newly added declaration, not a swap of an existing neutral token. * Theme: Share a transparent primitive across interactive tokens Several interactive background tokens (the weak/normal and disabled variants for the neutral, brand, and error tones) repeated the same inline fully-transparent value. Extract it into a shared `primitive.transparent` token and reference it, mirroring how the other disabled tokens already alias primitives. Internal-only: primitives are not emitted as custom properties, so there is no public API or resolved-value change. --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: aduth <aduth@git.wordpress.org>
1 parent fcaa78c commit cd7b4af

12 files changed

Lines changed: 167 additions & 48 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 ([#79124](https://github.com/WordPress/gutenberg/pull/79124)).
910

1011
### Breaking Changes
1112

packages/theme/docs/tokens.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,22 @@ The interactive state of the element. The default (no modifier) is the idle stat
161161
| `--wpds-color-background-interactive-neutral-strong-disabled` | Background color for interactive elements with neutral tone and strong emphasis, in their disabled state. |
162162
| `--wpds-color-background-interactive-neutral-weak` | Background color for interactive elements with neutral tone and weak emphasis. |
163163
| `--wpds-color-background-interactive-neutral-weak-active` | Background color for interactive elements with neutral tone and weak emphasis that are hovered, focused, or active. |
164-
| `--wpds-color-background-interactive-neutral-weak-disabled` | Background color for interactive elements with weak emphasis, in their disabled state, regardless of the tone. |
164+
| `--wpds-color-background-interactive-neutral-weak-disabled` | Background color for interactive elements with neutral tone and weak emphasis, in their disabled state. |
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 brand tone and strong emphasis, in their disabled state. |
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 brand tone and weak emphasis, in their disabled state. |
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 error tone and normal emphasis, in their disabled state. |
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 error tone and strong emphasis, in their disabled state. |
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 error tone and weak emphasis, in their disabled state. |
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). |
@@ -193,20 +198,24 @@ The interactive state of the element. The default (no modifier) is the idle stat
193198
| `--wpds-color-foreground-content-error-weak` | Foreground color for content like text with error tone and weak emphasis. |
194199
| `--wpds-color-foreground-interactive-neutral` | Foreground color for interactive elements with neutral tone and normal emphasis. |
195200
| `--wpds-color-foreground-interactive-neutral-active` | Foreground color for interactive elements with neutral tone and normal emphasis that are hovered, focused, or active. |
196-
| `--wpds-color-foreground-interactive-neutral-disabled` | Foreground color for interactive elements with normal emphasis, in their disabled state, regardless of the tone. |
201+
| `--wpds-color-foreground-interactive-neutral-disabled` | Foreground color for interactive elements with neutral tone and normal emphasis, in their disabled state. |
197202
| `--wpds-color-foreground-interactive-neutral-strong` | Foreground color for interactive elements with neutral tone and strong emphasis. |
198203
| `--wpds-color-foreground-interactive-neutral-strong-active` | Foreground color for interactive elements with neutral tone and strong emphasis that are hovered, focused, or active. |
199-
| `--wpds-color-foreground-interactive-neutral-strong-disabled` | Foreground color for interactive elements with strong emphasis, in their disabled state, regardless of the tone. |
204+
| `--wpds-color-foreground-interactive-neutral-strong-disabled` | Foreground color for interactive elements with neutral tone and strong emphasis, in their disabled state. |
200205
| `--wpds-color-foreground-interactive-neutral-weak` | Foreground color for interactive elements with neutral tone and weak emphasis. |
201-
| `--wpds-color-foreground-interactive-neutral-weak-disabled` | Foreground color for interactive elements with weak emphasis, in their disabled state, regardless of the tone. |
206+
| `--wpds-color-foreground-interactive-neutral-weak-disabled` | Foreground color for interactive elements with neutral tone and weak emphasis, in their disabled state. |
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 brand tone and normal emphasis, in their disabled state. |
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 brand tone and strong emphasis, in their disabled state. |
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 error tone and normal emphasis, in their disabled state. |
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 error tone and strong emphasis, in their disabled state. |
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. |
@@ -222,12 +231,14 @@ The interactive state of the element. The default (no modifier) is the idle stat
222231
| `--wpds-color-stroke-surface-error-strong` | Decorative stroke color used to define error-toned surface boundaries with strong emphasis. |
223232
| `--wpds-color-stroke-interactive-neutral` | Accessible stroke color used for interactive neutrally-toned elements with normal emphasis. |
224233
| `--wpds-color-stroke-interactive-neutral-active` | Accessible stroke color used for interactive neutrally-toned elements with normal emphasis that are hovered, focused, or active. |
225-
| `--wpds-color-stroke-interactive-neutral-disabled` | Accessible stroke color used for interactive elements with normal emphasis, in their disabled state, regardless of the tone. |
234+
| `--wpds-color-stroke-interactive-neutral-disabled` | Accessible stroke color used for interactive neutrally-toned elements with normal emphasis, in their disabled state. |
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 brand-toned elements with normal emphasis, in their disabled state. |
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 error-toned elements with normal emphasis, in their disabled state. |
231242
| `--wpds-color-stroke-interactive-error-strong` | Accessible stroke color used for interactive error-toned elements with strong emphasis. |
232243
| `--wpds-color-stroke-focus` | Accessible stroke color applied to focus rings. |
233244

0 commit comments

Comments
 (0)