Skip to content

experimental theme: a pressed or hovered part's flat tint is measured as the fill it is - #12787

Merged
josephfarina merged 1 commit into
feature/theme-editorfrom
josephfarina/theme-a/01-contrast-drawn
Nov 21, 2026
Merged

josephfarina merged 1 commit into
feature/theme-editorfrom
josephfarina/theme-a/01-contrast-drawn

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Faint text on a hovered or pressed part is found in the editor's pictures.

Problem and solution fit

The pictures' faint-text check skipped any text over a background image. A hover or press state draws its tint as a one-color gradient over the box's color, so faint text on a pressed button went unreported. A layer whose stops are all one color is now composited as a fill; a picture or a gradient between colors still leaves no one color behind.

Expected behavior and authority

Text contrast at 4.5:1 (3:1 for large text, edges and focus rings), as the editor's existing problem lines state.

Smallest restoration

One finding of a split stack; no new command or option.

Evidence

  • Before: a pressed button's tint was skipped.
  • After: it is measured as the fill it is, and faint text on it is reported.
  • Regression test: a pressed-tint case in theme-drawn-contrast-noted.test.mjs.

Scope

Components: theme editor (drawn-contrast probe)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

The touched tests, the stack's theme-editor tests, the CLI strict typecheck and eslint, on this layer's tree.

Gate

preflight: pass f49ce15
replay: worse 0 at f49ce15

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 21, 2026 5:57am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 19, 2026
@astracat-bot

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 21, 2026, 8:25 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about what the experimental theme editor's contrast checks measure, and two defects need fixing either way.

No current record defines these checks. An engineering owner needs to approve the new readings, or name the record that governs them, by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. The readings are: one-colour gradients count as fills, the top bar is composited over the page, the part-scoped fill and on-colour line, popover-filled panels need an edge against a surface or card, and the one-mode change list.

Blocking findings:

  • The new top-bar skip in packages/cli/api/theme-edit/_compiler.mjs (lines 853-861) stops measuring secondary Buttons on the page because the census also draws a Button in the top bar, so under a dark top bar white secondary-button text at 1.28:1 on the page (which the base reports) is no longer reported; skip the page check only for the TopNav parts and add that case to the test.
  • scopedFillPairProblems in packages/cli/api/theme-edit/_settings.mjs reports an inside <part>, --color-on-accent … 1.22:1 problem for parts that draw no on-accent text (a progress bar, slider, switch or link), and set refuses the fix line it offers, so the problem never clears; pair the tokens only when the part or something it holds reads the on-colour.

CI has not run on this head.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: a see-through fill is measured over the region it sits in (a top nav item in a translucent top bar), not the bare page. Verified: _compiler.mjs:740-762; the new test fails on the base and passes on the head.
  • Claim: a fill and its on-colour set inside a part are measured as that part draws them, with a fix line on that part. Verified for the top bar (new test). False for parts that draw no on-colour text (blocking finding 2).
  • Claim: a hover or pressed state's flat tint is measured in the pictures. Verified: drawn-contrast.mjs:120-180; the picture test fails on the base and passes on the head.
  • Claim: an open list or menu with no border or shadow is named when it matches the page or a surface it opens over. Verified (new test); it is also measured against a card.
  • Claim: a one-mode theme lists other-mode changes only where Core draws that mode (toast, lightbox). Verified (new test); the overlay scrim counts too.
  • Claim: a border the built theme draws counts as the panel's edge. Verified: _settings.mjs:12759-12775; new test.
  • Claim: before, a translucent dark top bar with white labels read 1.28:1. Verified on the base.
  • Claim: before, a white accent behind white top-bar labels gave no warning. Verified on the base.
  • Claim: before, a button's state tint went unmeasured. Verified on the base (pressed tint).
  • Claim: after, the translucent bar has no false problem, and a solid white bar still reports 1:1. Verified (new test).
  • Claim: after, the white accent reports 1.00:1 with a fix line. Verified (new test); following the fix clears it.
  • Claim: fresh official themes report no new problems. Verified: all seven report none on the base and on the head.
  • Claim: measurement only, no new command or option. Verified: no command doc or option changes.
  • Claim: no new public API hides under the fix. Verified for API; the behaviour itself waits on the owner decision above.
  • Claim: the CLI typechecks were run. The strict CLI typecheck fails on _how-question.mjs, a file this pull request does not change, and fails the same way on the base.
  • File .changeset/experimental-theme-contrast-measures-drawn.md: clear (a valid [experimental] patch).
  • File packages/cli/api/theme-edit/_compiler.mjs: blocking finding 1.
  • File packages/cli/api/theme-edit/_settings.mjs: blocking finding 2. Non-blocking: inMode is now the fourth copy of the same helper in this module.
  • File packages/cli/foundation/render/drawn-contrast.mjs: clear.
  • File packages/cli/api/theme-edit/theme-contrast-measures-whats-drawn.test.mjs: clear. It covers only a top-nav item and the top bar, so both findings need cases here.
  • File packages/cli/api/theme-edit/theme-drawn-contrast-noted.test.mjs: clear.

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the josephfarina/theme-a/01-contrast-drawn branch 2 times, most recently from d59bd02 to 7d2187e Compare November 19, 2026 02:29

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about what the experimental theme editor's contrast checks measure, and two defects need fixing either way.

No current record defines these checks. An engineering owner needs to approve the new readings, or name the record that governs them, by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. The readings are: one-colour gradients count as fills, the top bar is composited over the page, the part-scoped fill and on-colour line, popover-filled panels need an edge against a surface or card, and the one-mode change list.

Blocking findings:

  • The new top-bar skip in packages/cli/api/theme-edit/_compiler.mjs (lines 853-861) stops measuring secondary Buttons on the page because the census also draws a Button in the top bar, so under a dark top bar white secondary-button text at 1.28:1 on the page (which the base reports) is no longer reported; skip the page check only for the TopNav parts and add that case to the test.
  • scopedFillPairProblems in packages/cli/api/theme-edit/_settings.mjs reports an inside <part>, --color-on-accent … 1.22:1 problem for parts that draw no on-accent text (a progress bar, slider, switch or link), and set refuses the fix line it offers, so the problem never clears; pair the tokens only when the part or something it holds reads the on-colour.

CI has not run on this head.

Claims and files checked

Review mode: carry-forward; reason: none

  • Claim: a see-through fill is measured over the region it sits in (a top nav item in a translucent top bar), not the bare page. Verified: _compiler.mjs:740-762; the new test fails on the base and passes on the head.
  • Claim: a fill and its on-colour set inside a part are measured as that part draws them, with a fix line on that part. Verified for the top bar (new test). False for parts that draw no on-colour text (blocking finding 2).
  • Claim: a hover or pressed state's flat tint is measured in the pictures. Verified: drawn-contrast.mjs:120-180; the picture test fails on the base and passes on the head.
  • Claim: an open list or menu with no border or shadow is named when it matches the page or a surface it opens over. Verified (new test); it is also measured against a card.
  • Claim: a one-mode theme lists other-mode changes only where Core draws that mode (toast, lightbox). Verified (new test); the overlay scrim counts too.
  • Claim: a border the built theme draws counts as the panel's edge. Verified: _settings.mjs:12759-12775; new test.
  • Claim: before, a translucent dark top bar with white labels read 1.28:1. Verified on the base.
  • Claim: before, a white accent behind white top-bar labels gave no warning. Verified on the base.
  • Claim: before, a button's state tint went unmeasured. Verified on the base (pressed tint).
  • Claim: after, the translucent bar has no false problem, and a solid white bar still reports 1:1. Verified (new test).
  • Claim: after, the white accent reports 1.00:1 with a fix line. Verified (new test); following the fix clears it.
  • Claim: fresh official themes report no new problems. Verified: all seven report none on the base and on the head.
  • Claim: measurement only, no new command or option. Verified: no command doc or option changes.
  • Claim: no new public API hides under the fix. Verified for API; the behaviour itself waits on the owner decision above.
  • Claim: the CLI typechecks and the CLI structure check pass. Verified for the template-docs, JSON API and authoring typechecks and the structure check; the strict typecheck's only errors are two page templates importing a theme build output that was not built for this check, in files this pull request does not change.
  • File .changeset/experimental-theme-contrast-measures-drawn.md: clear (a valid [experimental] patch).
  • File packages/cli/api/theme-edit/_compiler.mjs: blocking finding 1.
  • File packages/cli/api/theme-edit/_settings.mjs: blocking finding 2. Non-blocking: inMode is now the fourth copy of the same helper in this module.
  • File packages/cli/foundation/render/drawn-contrast.mjs: clear.
  • File packages/cli/api/theme-edit/theme-contrast-measures-whats-drawn.test.mjs: clear. It covers only a top-nav item and the top bar, so both findings need cases here.
  • File packages/cli/api/theme-edit/theme-drawn-contrast-noted.test.mjs: clear.

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the theme-r15-p22 branch 7 times, most recently from 0712faa to 0ecd1a5 Compare November 19, 2026 04:17
@josephfarina
josephfarina force-pushed the josephfarina/theme-a/01-contrast-drawn branch from 7d2187e to 8bb8753 Compare November 19, 2026 04:25

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about what the experimental theme editor's contrast checks measure, and two defects need fixing either way.

No current spec defines these checks, so an engineering owner needs to approve the new readings, or name the spec that governs them, by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. The readings to settle are: one-colour gradients count as fills, the top bar is composited over the page, the part-scoped fill and on-colour line, popover-filled panels need an edge against a surface or card, and the one-mode change list.

Blocking findings:

  • The top-bar skip in packages/cli/api/theme-edit/_compiler.mjs (lines 853-861) stops measuring secondary Buttons on the page because the census also draws a Button in the top bar, so under a dark top bar white secondary-button text at 1.28:1 on the page (which the base reports) is no longer reported; skip the page check only for the TopNav parts and add that case to the test.
  • scopedFillPairProblems in packages/cli/api/theme-edit/_settings.mjs (lines 12104-12149) reports an inside <part>, --color-on-accent … 1.22:1 problem for parts that draw no on-accent text (a progress bar or a link), and set refuses the fix line it offers, so the problem never clears; pair the tokens only when the part or something it holds reads the on-colour.

CI has not run on this head.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: a see-through fill is measured over the region it sits in (a top nav item in a translucent top bar), not the bare page. Verified: _compiler.mjs:740-762; the new test fails on the base and passes on the head.
  • Claim: a fill and its on-colour set inside a part are measured as that part draws them, with a fix line on that part. Verified for the top bar (new test); false for parts that draw no on-colour text (second blocking finding).
  • Claim: a hover or pressed state's flat tint is measured in the pictures. Verified: drawn-contrast.mjs:120-198; the picture test fails on the base and passes on the head.
  • Claim: an open list or menu with no border or shadow is named when it matches the page or a surface it opens over. Verified (new test); it is also measured against a card.
  • Claim: a one-mode theme lists other-mode changes only where Core draws that mode (toast, lightbox). Verified (new test); the overlay scrim counts too.
  • Claim: a border the built theme draws counts as the panel's edge. Verified: _settings.mjs:12755-12771; new test.
  • Claim: before, a translucent dark top bar with white labels read 1.28:1. Verified on the base.
  • Claim: before, a white accent behind white top-bar labels gave no warning. Verified on the base.
  • Claim: before, a button's state tint went unmeasured. Verified on the base (pressed tint).
  • Claim: after, the translucent bar has no false problem, and a solid white bar still reports 1:1. Verified (new test).
  • Claim: after, the white accent reports 1.00:1 with a fix line. Verified (new test); following the fix clears it.
  • Claim: fresh official themes report no new problems. Verified: all seven show no open problems on the base and on the head.
  • Claim: measurement only, no new command or option. Verified: no command doc, option or export changes.
  • Claim: no new public API hides under the fix. Verified for API; the behaviour itself waits on the owner decision above.
  • Claim: the theme-editor tests, the five CLI typechecks and the CLI structure check pass. Verified: the two changed test files and 26 related theme-editor test files pass, the typechecks pass (the strict one once the neutral theme package is built), and the structure check passes.
  • File .changeset/experimental-theme-contrast-measures-drawn.md: clear (a valid [experimental] patch).
  • File packages/cli/api/theme-edit/_compiler.mjs: first blocking finding.
  • File packages/cli/api/theme-edit/_settings.mjs: second blocking finding. Non-blocking: inMode is another copy of the same helper in this module; Miss: the experimental API's changedPartTokens description still says every moved custom property is listed, which the one-mode filter no longer does.
  • File packages/cli/foundation/render/drawn-contrast.mjs: clear.
  • File packages/cli/api/theme-edit/theme-contrast-measures-whats-drawn.test.mjs: clear; it covers only a top-nav item and the top bar, so both findings need cases here.
  • File packages/cli/api/theme-edit/theme-drawn-contrast-noted.test.mjs: clear.

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the theme-r15-p22 branch 5 times, most recently from 623ee88 to f31108c Compare November 19, 2026 06:04
@josephfarina
josephfarina force-pushed the theme-r15-p22 branch 23 times, most recently from 461d531 to c686df1 Compare November 19, 2026 22:04

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about what the experimental theme editor's contrast checks measure, and three defects need fixing either way.

No current spec defines these checks, so an engineering owner needs to approve the five readings below, or name the spec that governs them, by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.

  1. A one-colour gradient layer in a picture counts as a fill under text.
  2. Text on a see-through top bar is measured over the bar blended on the page, while a lightbox, toast or scrim keeps its own colour.
  3. A fill token set on a part is paired with its on-colour inside that part, with its own problem line.
  4. Every part filled with --color-background-popover needs an edge against the page, a surface and a card, and a border the built theme writes counts as that edge.
  5. A one-mode theme lists other-mode token changes only for tokens the lightbox, toast and scrim read.

Blocking, whatever the owner decides:

  • The top-bar skip in packages/cli/api/theme-edit/_compiler.mjs (lines 854-862) drops the page measurement for every pair the census also draws in the top bar, so white secondary Button text under a #0f172a bar is no longer reported although it reads 1.28:1 on the page; skip the page pair only for parts drawn only in the bar (TopNav, its items and heading) and add that case to the test.
  • scopedFillPairProblems in packages/cli/api/theme-edit/_settings.mjs (lines 12474-12519) reports inside progress-bar and inside link problems whose own fix set refuses, because those parts never read --color-on-accent; skip a pair unless the part, or a part it holds, reads the on-token.
  • Miss: on a button the same check repeats the primary-variant problem with a second, different fix, and after the first fix (--color-on-accent '#000000' --when variant:primary) show still reports inside button … 1.22:1 because the check ignores --when settings (lines 12489-12495); leave out pairs the existing text-pair check already measures, or read the on-token through the same variant settings.

Non-blocking: the lowContrastText JSDoc in drawn-contrast.mjs (lines 27-28) and the changedPartTokens JSDoc in theme-edit.type.mjs (line 101) no longer describe what is measured and listed.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: a see-through fill is measured over the region it sits in, not the bare page: verified (new test fails on the base, passes on the head).
  • Claim: a fill and its on-colour set inside a part are measured as that part draws them, with a fixing line: verified for the top bar; false for progress bars, links and buttons (blocking findings 2 and 3).
  • Claim: a hover or pressed state's flat tint is measured in pictures: verified for the pressed tint (picture test fails on the base, passes on the head).
  • Claim: an open list or menu with no border or shadow is named against the page or a surface: verified (six panels named on a surface on the head).
  • Claim: a one-mode theme lists other-mode changes only where Core draws that mode: verified (27 light lines on the base, 5 on the head for a dark-only theme).
  • Claim: before the change, the translucent bar read 1.28:1, the white accent gave no warning and the tint went unmeasured: verified on the base.
  • Claim: after the change, no false problem on the translucent bar, a solid white bar still reports 1:1, and the white accent reports 1.00:1 with a fix: verified; the fix clears it.
  • Claim: fresh official themes report no new problems: verified for all seven themes on the base and the head.
  • Claim: measurement only, with no new command, option or public API: verified (exports and command docs unchanged).
  • Claim: the named regression tests and checks pass: verified (8 of 8 tests; 123 related test files pass; structure, changeset and lint checks pass; four CLI typechecks pass, the strict one after building the neutral theme; the declaration-emitting typecheck was not run).
  • File .changeset/experimental-theme-contrast-measures-drawn.md: clear (experimental patch); its part-scoped claim is partly false (findings 2 and 3).
  • File packages/cli/api/theme-edit/_compiler.mjs: finding 1.
  • File packages/cli/api/theme-edit/_settings.mjs: findings 2 and 3; non-blocking JSDoc note.
  • File packages/cli/foundation/render/drawn-contrast.mjs: clear; non-blocking JSDoc note.
  • File packages/cli/api/theme-edit/theme-contrast-measures-whats-drawn.test.mjs: clear; it needs cases for the three findings.
  • File packages/cli/api/theme-edit/theme-drawn-contrast-noted.test.mjs: clear.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about what the experimental theme editor's contrast checks measure, and three defects need fixing either way.

No current spec defines these checks, so an engineering owner needs to approve the five readings below, or name the spec that governs them, by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.

  1. A one-colour gradient layer in a picture counts as a fill under text.
  2. Text on a see-through top bar is measured over the bar blended on the page, while a lightbox, toast or scrim keeps its own colour.
  3. A fill token set on a part is paired with its on-colour inside that part, with its own problem line.
  4. Every part filled with --color-background-popover needs an edge against the page, a surface and a card, and a border the built theme writes counts as that edge.
  5. A one-mode theme lists other-mode token changes only for tokens the lightbox, toast and scrim read.

Blocking, whatever the owner decides:

  • The top-bar skip in packages/cli/api/theme-edit/_compiler.mjs (lines 854-862) drops the page measurement for every pair the census also draws in the top bar, so white secondary Button text under a #0f172a bar is no longer reported although it reads 1.28:1 on the page; skip the page pair only for parts drawn only in the bar (TopNav, its items and heading) and add that case to the test.
  • scopedFillPairProblems in packages/cli/api/theme-edit/_settings.mjs (lines 12474-12519) reports inside progress-bar and inside link problems whose own fix set refuses, because those parts never read --color-on-accent; skip a pair unless the part, or a part it holds, reads the on-token.
  • Miss: on a button the same check repeats the primary-variant problem with a second, different fix, and after the first fix (--color-on-accent '#000000' --when variant:primary) show still reports inside button … 1.22:1 because the check ignores --when settings (lines 12489-12495); leave out pairs the existing text-pair check already measures, or read the on-token through the same variant settings.

Non-blocking: the lowContrastText JSDoc in drawn-contrast.mjs (lines 27-28) and the changedPartTokens JSDoc in theme-edit.type.mjs (line 101) no longer describe what is measured and listed.

Claims and files checked

Review mode: carry-forward; reason: none

  • Claim: a see-through fill is measured over the region it sits in, not the bare page: verified (new test fails on the base, passes on the head).
  • Claim: a fill and its on-colour set inside a part are measured as that part draws them, with a fixing line: verified for the top bar; false for progress bars, links and buttons (blocking findings 2 and 3).
  • Claim: a hover or pressed state's flat tint is measured in pictures: verified for the pressed tint (picture test fails on the base, passes on the head).
  • Claim: an open list or menu with no border or shadow is named against the page or a surface: verified (six panels named on a surface on the head).
  • Claim: a one-mode theme lists other-mode changes only where Core draws that mode: verified (27 light lines on the base, 5 on the head for a dark-only theme).
  • Claim: before the change, the translucent bar read 1.28:1, the white accent gave no warning and the tint went unmeasured: verified on the base.
  • Claim: after the change, no false problem on the translucent bar, a solid white bar still reports 1:1, and the white accent reports 1.00:1 with a fix: verified; the fix clears it.
  • Claim: fresh official themes report no new problems: verified for all seven themes on the base and the head.
  • Claim: measurement only, with no new command, option or public API: verified (exports and command docs unchanged).
  • Claim: the named regression tests and checks pass: verified (8 of 8 tests; 123 related test files pass; structure, changeset and lint checks pass; four CLI typechecks pass, the strict one after building the neutral theme; the declaration-emitting typecheck was not run).
  • File .changeset/experimental-theme-contrast-measures-drawn.md: clear (experimental patch); its part-scoped claim is partly false (findings 2 and 3).
  • File packages/cli/api/theme-edit/_compiler.mjs: finding 1.
  • File packages/cli/api/theme-edit/_settings.mjs: findings 2 and 3; non-blocking JSDoc note.
  • File packages/cli/foundation/render/drawn-contrast.mjs: clear; non-blocking JSDoc note.
  • File packages/cli/api/theme-edit/theme-contrast-measures-whats-drawn.test.mjs: clear; it needs cases for the three findings.
  • File packages/cli/api/theme-edit/theme-drawn-contrast-noted.test.mjs: clear.

Automated review (maintainer link)

… as the fill it is

The pictures' faint-text check skipped any text over a background image. A hover or press state draws its tint as a one-color gradient over the box's color, so faint text on a pressed button went unreported. A layer whose stops are all one color is now composited as a fill; a picture or a gradient between colors still leaves no one color behind.

[skip ci]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about what the experimental theme editor's faint-text check measures, and one defect needs fixing either way.

No current spec says which ground the pictures' faint-text notes measure, so an engineering owner needs to approve this pull request's reading, or name the spec that governs it, by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. The reading: a background layer that is one flat colour counts as a fill under the text, composited over the box's own colour, and such a layer on a box beside the text no longer marks the text as over a picture.

Blocking, whatever the owner decides:

  • Miss: flatLayers() and behind() in packages/cli/foundation/render/drawn-contrast.mjs (lines 123-180) treat a one-colour layer as covering its whole box whatever its background-size, background-position and background-repeat, so a link with a 2px linear-gradient(#111111, #111111) bottom / 100% 2px no-repeat underline is noted at 1:1 and a layer sized 0 0 turns a 4.54:1 button into a 1.26:1 note; count a layer as a fill only when it covers the box, and add both cases to theme-drawn-contrast-noted.test.mjs.

Non-blocking: a one-colour tint on a sibling box no longer keeps the text out (white text over a 70% black tint is noted at 1:1), an oklch() stop beside an rgb() stop reads as one flat colour, and the lowContrastText and behind JSDoc (lines 27-28 and 99-101) still describe the old rule.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: before this change the faint-text check skipped any text over a background image: verified (the base returned no colour for any background image).
  • Claim: hover and pressed states draw their tint as a one-colour gradient over the box's colour: verified in Core's press and interaction-overlay styles.
  • Claim: a layer whose stops are all one colour is now composited as a fill: verified, including layers that cover only part of the box (the blocking finding).
  • Claim: a picture or a gradient between colours still leaves no one colour behind: verified for rgb() stops; false when one stop is oklch() (non-blocking).
  • Claim: a pressed tint was skipped before and faint text on it is reported now: verified (the new test case fails on the base and passes on the head).
  • Claim: a pressed-tint regression case is in theme-drawn-contrast-noted.test.mjs: verified.
  • Claim: no new command, option or public API: verified (exports and command docs unchanged).
  • Claim: the touched tests, the theme-editor tests, the CLI strict typecheck and eslint pass: verified for the touched test, the render and picture tests, eslint, and the strict typecheck once the neutral theme is built; the whole theme-editor suite also passes (547 files).
  • File .changeset/experimental-theme-contrast-state-tint.md: clear (experimental patch for the CLI).
  • File packages/cli/foundation/render/drawn-contrast.mjs: the blocking finding; three non-blocking notes.
  • File packages/cli/api/theme-edit/theme-drawn-contrast-noted.test.mjs: clear; it needs the partial-layer cases.

Automated review (maintainer link)

// (A flat tint drawn as an image, a hover or pressed state's
// one-color gradient, is a fill like any other, drawn over the
// box's color; any other image leaves no one color behind.)
const tints = flatLayers(cs.backgroundImage);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Miss: this takes every one-colour layer as covering the whole box, but its background-size, background-position and background-repeat are never read. A link whose 2px underline is linear-gradient(#111111, #111111) bottom / 100% 2px no-repeat (the editor writes these longhands for a background set on a state) is now noted at 1:1 (#111111 on #111111), and a layer sized 0 0 turns a 4.54:1 button into a 1.26:1 note; the base left both out. Count a flat layer as a fill only when its computed size covers the box (auto, cover, contain, 100% 100%, or a non-zero tile repeating on both axes), return null otherwise, and add both cases to the test.

@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed on main in #13470.

This branch was successfully deployed

1 active deployment
Preview — f49ce155 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant