Closed Bug 2071602 Opened 2 months ago Closed 2 months ago

Document high contrast, chrome-versus-content and design-token behaviour in the front-end CSS docs

Categories

(Developer Infrastructure :: Source Documentation, task)

task

Tracking

(firefox158 fixed)

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(3 external files)

The CSS guidelines page covers high contrast mode in terms of the two automatic adjustments Gecko makes in the content area, and says nothing about the regimes that decide whether those adjustments happen at all, or about what the forced-color adjustment does to an individual declaration. Several behaviors front-end CSS has to account for are currently only learned by asking someone:

  • Forced colors and prefers-contrast are separate signals with separate sources, and a chrome document never actually forces colors, so a shared stylesheet takes a branch in an about: page that it never takes in the toolbar.
  • The forced-color adjustment filters author colors per property, so transparent survives as a background-color and becomes CanvasText as a border-color.
  • A layered token override loses to any unlayered declaration, which can leave a surface with no high contrast styling at all.
  • rem is the system UI font size in chrome, not 16px, so the 16px-based space scale runs short there.
  • Every *.tokens.css is generated from the *.tokens.json beside it, and mach buildtokens prunes Nova overrides as well as generating them.

This bug adds them to the pages that already have a section for each: docs/code-quality/coding-style/css_guidelines.md, the design-system token docs, and the use-design-tokens space rule page.

Blocks: 2071608

The document_color_use Windows default in ColorsAndHighContrastMode.md said 2, against 0 in StaticPrefList.yaml, and the table added here contradicted it.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d117d2f01d5f https://hg.mozilla.org/integration/autoland/rev/f4435b59aef5 Document the forced-colors and prefers-contrast regimes in the CSS guidelines. r=mkennedy https://github.com/mozilla-firefox/firefox/commit/d824424cadc9 https://hg.mozilla.org/integration/autoland/rev/030bb75d0b2d Document the chrome-versus-in-content differences and device-pixel rounding in the CSS guidelines. r=desktop-theme-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/4dba3550a06c https://hg.mozilla.org/integration/autoland/rev/c417af1a30e9 Document the token generation pipeline and chrome's rem in the design-token docs. r=mkennedy
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
See Also: → 2085331
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: