Add a stylelint rule that requires a high contrast guard on design token overrides
Categories
(Developer Infrastructure :: Linting and Formatting: CSS, task)
Tracking
(Not tracked)
People
(Reporter: dao, Assigned: dao)
References
(Blocks 3 open bugs)
Details
Attachments
(5 external files)
Many design tokens have their own prefers-contrast and forced-colors values. A rule that overrides such a token with a literal, outside a high contrast media query, replaces those values, so the surface loses its high contrast colors.
Add a no-unguarded-high-contrast-token-overrides rule that reports such overrides and autofixes them by adding the guard, with ./mach buildtokens generating the list of tokens that have high contrast values. Fix or annotate the existing hits.
| Assignee | ||
Updated•12 days ago
|
| Assignee | ||
Comment 1•12 days ago
|
||
Updated•12 days ago
|
| Assignee | ||
Comment 2•12 days ago
|
||
The sweep is value-neutral outside forced colors and prefers-contrast. Under those, the newly guarded overrides give way to the tokens' own high-contrast values.
| Assignee | ||
Comment 3•10 days ago
|
||
The sweep is value-neutral outside forced colors and prefers-contrast. Under those, the newly guarded overrides give way to the tokens' own high-contrast values.
The seven overrides it leaves unguarded keep their values on purpose; the next commit, which adds the stylelint rule, marks them with a disable comment and the reason.
Comment 4•10 days ago
|
||
The following patch is waiting for review from an inactive reviewer:
| ID | Title | Author | Reviewer Status |
|---|---|---|---|
| D341321 | Bug 2090679 - Guard the token overrides that hide the tokens' high-contrast values. r?#desktop-theme-reviewers | dao | ngrato: Back Nov 21, 2026 |
:dao, could you please find another reviewer?
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 5•7 days ago
|
||
| Assignee | ||
Comment 6•7 days ago
|
||
| Assignee | ||
Updated•3 days ago
|
Description
•