Open Bug 2090679 Opened 12 days ago Updated 2 days ago

Add a stylelint rule that requires a high contrast guard on design token overrides

Categories

(Developer Infrastructure :: Linting and Formatting: CSS, task)

task

Tracking

(Not tracked)

ASSIGNED

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.

Blocks: css-linting
Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED

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 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.

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.

Flags: needinfo?(dao+bmo)
Component: Lint and Formatting → Linting and Formatting: CSS
Flags: needinfo?(dao+bmo)
Blocks: 2094532
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: