Open Bug 2090680 Opened 12 days ago Updated 2 days ago

Add a stylelint rule that requires the boolean `forced-colors` media query

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

(3 external files)

(forced-colors: active) never matches browser chrome under Windows high contrast mode, where forced colors are in the requested state. In content it matches the same as (forced-colors).

This matters most for stylesheets that load in both realms, such as shared components or aboutwelcome.css, which feature callouts load into chrome: a block tested in content silently does nothing in chrome. The boolean query is right in both.

Add a use-boolean-forced-colors-query rule with an autofix, and convert the existing uses.

(forced-colors: active) never matches browser chrome under Windows high contrast mode, which is in the requested state, and in content it is equivalent to the boolean query, so the sweep changes only Windows chrome under high contrast mode.

There, both blocks in smartwindowGroupTabs.css and the empty-state block in agent-monitor-panel.css start to apply, and feature callouts, which load aboutwelcome.css into chrome through FeatureCallout.sys.mjs, now get its picker, carousel-nav and multi-select system-color blocks.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED

(forced-colors: active) never matches browser chrome under Windows high contrast mode, which is in the requested state, and in content it is equivalent to the boolean query, so this changes only Windows chrome under high contrast mode.

There, both blocks in smartwindowGroupTabs.css and the empty-state block in agent-monitor-panel.css start to apply, and feature callouts, which load aboutwelcome.css into chrome through FeatureCallout.sys.mjs, now get its picker, carousel-nav and multi-select system-color blocks.

The following patch is waiting for review from an inactive reviewer:

ID Title Author Reviewer Status
D341043 Bug 2090680 - Replace (forced-colors: active) with the boolean forced-colors media query. 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)
Flags: needinfo?(dao+bmo)
Component: Lint and Formatting → Linting and Formatting: CSS
Blocks: 2094532
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: