Skip to content

fix(cli): theme build leaves the page's color scheme to the page - #12250

Merged
josephfarina merged 4 commits into
mainfrom
theme-build-page-scheme
Nov 18, 2026
Merged

josephfarina merged 4 commits into
mainfrom
theme-build-page-scheme

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A site that loads a built Astryx theme stylesheet (for example @astryxdesign/theme-neutral/theme.css) without reset.css, and sets no color scheme of its own, starts following the reader's device. For a reader in dark mode, the site's native inputs, its default link color and its page canvas turn dark, while its own explicitly colored areas stay light. Installing a theme must leave the host's page alone; reset.css is the one place an app opts into following the device.

Problem and solution fit

  1. Why it occurs: every built theme stylesheet with light-dark() values begins with :root { color-scheme: light dark; }. A --family build puts the same light dark rule on each member's scope.
  2. Why it harms the task: the host never opted into the device's scheme, yet loading the theme's CSS changes it.
  3. Why that matters: established apps adopt Astryx this way (theme CSS, their own preflight), and the setup check's rule is that installing Astryx changes none of the host's own styles or color-mode behavior. Core's stylesheet follows the same placement in a separate fix (fix(Theme): the page root follows the reader only through reset.css, so Core's stylesheet leaves a host's scheme alone #12247).

The fix removes only that rule. A theme follows the page's scheme and still pins it where the page or the Theme provider forces a mode.

Expected behavior and authority

  • spec:AST-066 FR16, amended in this PR, and the new DEC-11 (decider: josephfarina, HQ under his delegation): a theme bundle emits only the two mode pins (html[data-theme="light"|"dark"]) and never declares color-scheme: light dark on the root or on a theme's scope; following the device is the page's own choice (reset.css, or its own color-scheme on html). DEC-7 keeps its text and decider and names DEC-11, which replaces its root rule.

Smallest restoration

  • packages/cli/api/theme/build/build.mjs: the color-scheme block keeps the two html[data-theme] pins and drops the :root line.
  • packages/cli/api/theme/build/family.mjs: each member's scope keeps the pins for a mode html forces and drops its light dark rule.
  • Media-surface flips, adaptations and every other output are unchanged.

Evidence

  • Official themes, rebuilt before and after with their own package build command (theme build src/<name>Theme.ts -o dist/theme.css --icons-specifier ./icons.mjs): the only difference in butter, chocolate, matcha, neutral, stone and y2k is the removed line :root { color-scheme: light dark; }. gothic, which has no light-dark() value, is byte-identical.
  • In Chromium, a white host page with no scheme of its own loading a theme's light-dark() values:
    • today: the dark-mode reader sees the theme's background resolve dark and native inputs turn dark (#3b3b3b);
    • after: the page stays light;
    • with reset.css (html { color-scheme: light dark }): dark for the dark-mode reader, as before;
    • with the host's own html[data-theme="dark"]: dark, as before.
  • New canonical setup case (setup-canonical.test.ts): the plain Tailwind host, which names no scheme, loads astryx.css and the neutral theme.css without reset.css and adds an Astryx button. The root's computed color-scheme stays normal in the light and the dark reader runs, and the host shows no regression. fix(Theme): the page root follows the reader only through reset.css, so Core's stylesheet leaves a host's scheme alone #12247 (merged) removed the same root rule from Core's stylesheet; on main with this PR, the new case, fix(Theme): the page root follows the reader only through reset.css, so Core's stylesheet leaves a host's scheme alone #12247's Core-only case, the standard s1 install and the guest-contained install all pass.
  • build-theme.color-scheme.test.mjs, build-theme.adaptations.test.mjs and build.family.test.mjs assert the two pins and no color-scheme: light dark anywhere in standalone and family output.

Scope

Components: CLI theme build (standalone and family)

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

Migration (in the changeset): to follow the device with theme CSS alone, add reset.css or html { color-scheme: light dark }.

Writing rubric results

  • R1 narration: none; FR16 and DEC-11 state what a theme bundle emits, in the present tense; DEC-7's one added line names the decision that replaces its root rule.
  • R2 research: none in the record.
  • R3 evidence: the verification paragraph names the checks, not a change.
  • R4 rejected alternatives: one, in DEC-11, one line.
  • R5 change references: none.
  • R6 open questions: none.
  • R7 project status: none.

Testing

  • vitest run --project node packages/cli/clients/cli/commands/build-theme packages/cli/api/theme/build (the theme build and family suites)
  • ASTRYX_CANONICAL_SETUP_BROWSER=1 vitest run internal/vibe-tests/setup-test/setup-canonical.test.ts --project node --maxWorkers=1 (on main with this PR: the new case, fix(Theme): the page root follows the reader only through reset.css, so Core's stylesheet leaves a host's scheme alone #12247's Core-only case, the standard s1 install, the guest-contained install)
  • The theme editor suites that read color-scheme, plus setup-integrity and setup-workspace
  • tsc --project tsconfig.strict.json, eslint, prettier, check-changesets, check:knowledge

@vercel

vercel Bot commented Nov 17, 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 18, 2026 4:35am UTC

Request Review

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

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 4:39 AM UTC

@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): built theme stylesheets and family scopes stop writing color-scheme: light dark. They keep the explicit light and dark pins on html[data-theme] and the media-surface flips, so a host's page scheme is left alone, consistent with Core's stylesheet. This ships as a fix with a migration line for apps that use only the theme CSS. The canonical setup case shows the root as normal, and the official themes rebuild with only that rule removed. spec:AST-066 FR16 and DEC-7 record the two-pin policy.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 4f42d65

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 7855f83

Storybook · Sandbox · built from this PR's head

Package size:

  • @astryxdesign/cli 5.39 MB packed (+164 B); no new dependencies
  • @astryxdesign/theme-butter 56.2 kB packed (−6 B); no new dependencies
  • @astryxdesign/theme-chocolate 18.1 kB packed (−9 B); no new dependencies
4 more packages
  • @astryxdesign/theme-matcha 29.5 kB packed (−6 B); no new dependencies
  • @astryxdesign/theme-neutral 41.3 kB packed (−4 B); no new dependencies
  • @astryxdesign/theme-stone 41.1 kB packed (−7 B); no new dependencies
  • @astryxdesign/theme-y2k 45.3 kB packed (−6 B); no new dependencies

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@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 a decision for spec:AST-066 DEC-7 and on one fix to the new canonical setup case.

  • The new case in internal/vibe-tests/setup-test/setup-canonical.test.ts (a host that loads Core's and the neutral theme's stylesheets without reset.css) fails at this head because Core's stylesheet still sets the root to light dark, as spec:AST-080 FR3 requires, so move the case into #12247, or put this pull request on top of #12247 and declare both with a Stack: #12247 → #12250 line, so test-build cannot go red if this merges first.

This pull request changes DEC-7's Decider: line, which under the record rules needs the original decider recorded on that line to approve this exact head (an approving review or /approve-spec <full head SHA>); alternatively, keep that line and record the two-pin policy as a new decision with its own decider. The theme output change itself holds up: the rebuilt official themes differ only by the removed root rule, and the updated theme-build tests fail on the base and pass here. Optional follow-ups: setup-integrity.mjs still documents the three-rule block, and the record's "Current-state impact" paragraph still calls the color-scheme rules unchanged.

Claims and files checked

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

  • Changeset: theme build no longer sets the page root's color scheme: verified (build.mjs:5784-5788; rebuilt official themes)
  • Changeset: built theme stylesheets used to declare the root light dark rule: verified (base theme output)
  • Changeset: a site loading it without reset.css and with no scheme followed the reader's device: verified for theme CSS alone in Chromium
  • Changeset: the theme still pins a mode the page or the Theme provider forces: verified (theme-build tests, rebuilt output)
  • Changeset: a --family build drops the same rule from each scope: verified (family.mjs:451-452, family test)
  • Changeset: apps that import reset.css see no change: verified (reset.css sets the root and the data-theme pins itself)
  • Changeset: migration through reset.css or html { color-scheme: light dark }: verified
  • Description: rebuilt official themes differ only by the removed line, gothic byte-identical: verified
  • Description: media-surface flips, adaptations and other output unchanged: verified (one-line output diff)
  • Description: with Core's stylesheet the new canonical case needs #12247: verified; the case fails at this head (blocking finding)
  • Description: the three theme-build tests assert two pins and no light dark: verified (fail on the base, pass at this head)
  • Description: the record states the two-pin policy, decided by owners: the content is approved by an engineering owner at this head; the change to DEC-7's Decider line still needs its original decider
  • Description: the standard and guest-contained setup installs still pass: not reproduced (needs registry installs and a browser build)
  • Description: theme suites, strict typecheck, lint, formatting, changeset and knowledge checks pass: verified
  • File .changeset/theme-build-follows-page-scheme.md: clear (release-order note)
  • File docs/specs/AST-066-theme-data-boundary/spec.md: DEC-7 Decider line needs its original decider; Current-state impact wording note
  • File internal/vibe-tests/setup-test/setup-canonical.test.ts: blocking, the new case fails at this head
  • File packages/cli/api/theme/build/build.mjs: clear
  • File packages/cli/api/theme/build/family.mjs: clear
  • File packages/cli/api/theme/build/build.family.test.mjs: clear
  • File packages/cli/clients/cli/commands/build-theme.adaptations.test.mjs: clear
  • File packages/cli/clients/cli/commands/build-theme.color-scheme.test.mjs: clear

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the theme-build-page-scheme branch from 4f42d65 to 4cf138c Compare November 17, 2026 08:38
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 4cf138c

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec e0db2c2

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026

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

Changes requested: the theme build change works and an engineering owner approved its record changes at this head, but three problems need fixing first.

  • useTheme() returns light on a page that declares <meta name="color-scheme" content="light dark"> and loads no reset.css, although Chromium draws that page and its system Themes dark for a dark reader, so charts and canvas paint light on a dark page (packages/core/src/theme/useTheme.ts:245-247).
  • A theme's @dark component blocks still follow prefers-color-scheme (packages/core/src/theme/generateThemeRules.ts:1480-1486), so on a page without reset.css, which is now light, a dark reader still gets the dark overrides, which makes the changeset's "an Astryx widget on a light page never turns dark" false and leaves architecture:theme-compilation INV18 (a block applies only in its mode "as Theme resolves it") in conflict with the amended Theme records.
  • The Stack: #12247 → #12250 line does not hold, because #12247's description does not carry it and this branch is built on an earlier revision of #12247 rather than its current head, so merging this pull request would land that revision with the two problems above, which #12247 has already fixed.

Rebasing onto #12247's current head and adding the same Stack line to #12247 should resolve all three. CI did not run on this head because its run was cancelled for capacity, so it needs a re-run.

Claims and files checked

Review mode: full; reason: rebase

Claims (description):

  • At the base, every built theme stylesheet with light-dark() values sets the root to light dark, and a family build sets each member's scope the same way: verified (base build.mjs and family.mjs; base theme builds).
  • The fix removes only that rule, and a theme still pins the scheme where html forces a mode: verified (build.mjs:5738-5742, family.mjs:449-452).
  • FR16 is amended, DEC-11 records the policy, and DEC-7 keeps its text and decider and names DEC-11: verified (DEC-7's Decider line is unchanged; one line is appended).
  • Media-surface flips, adaptations and other output are unchanged; six official themes lose only the root line, and gothic is byte-identical: verified (all seven themes rebuilt on base and head).
  • In Chromium, a host with no scheme of its own that loads theme CSS goes from dark to light for a dark reader: verified (host page probe: root light dark on the base, normal on the head).
  • With reset.css, or a host that forces dark, the page is still dark: verified from code (the reset.css root rule and the html[data-theme] pins are unchanged).
  • The new canonical setup case keeps the root normal: consistent at this head, because Core's stylesheet no longer has a root rule (head build and probe); the case itself was not run here.
  • This pull request sits on #12247: false (third finding).
  • The theme-build tests assert the pins and no light dark declaration: verified for standalone output; the family test checks only the dark pins.
  • The changeset carries a migration line for apps without reset.css: verified.

Claims (changesets):

  • Theme build no longer sets the page root's scheme, the family build drops the scope rule, and apps with reset.css see no change: verified.
  • A system Theme resolves to the root's scheme, and to light when the root names none: verified (useTheme.ts:245-247).
  • useTheme() matches the CSS, so charts and canvas match: false when a color-scheme meta names both schemes (first finding).
  • A light page's Astryx widget never turns dark: false for themes with @dark blocks (second finding).
  • Core's stylesheet, prebuilt or source-built, sets no root scheme: verified (head build of astryx.css; layer and source-build tests pass).

Files:

  • .changeset/theme-build-follows-page-scheme.md: clear (non-blocking: it ships as a patch fix with a migration line, by the owner's decision).
  • .changeset/theme-system-follows-host-scheme.md: two false claims (first and second findings).
  • docs/architecture/theme-application.md: clear (owner-approved); its INV7 failure signal is what the first finding breaks.
  • docs/specs/AST-066-theme-data-boundary/spec.md: clear (owner-approved).
  • docs/specs/AST-080-package-stylesheets/spec.md: clear (owner-approved).
  • docs/specs/components/theme/Theme.spec.md: clear (owner-approved); together with an unchanged INV18 it gives the second finding.
  • internal/vibe-tests/setup-test/setup-canonical.test.ts: clear (its expectation now matches what this head draws).
  • internal/vibe-tests/setup-test/setup-integrity.mjs: clear.
  • packages/build/src/next.turbopack.test.mjs: clear.
  • packages/build/src/source-stylesheet.js: clear.
  • packages/build/src/source-stylesheet.test.mjs: clear (passes).
  • packages/cli/api/theme/build/build.family.test.mjs: clear (passes).
  • packages/cli/api/theme/build/build.mjs: clear.
  • packages/cli/api/theme/build/family.mjs: clear.
  • packages/cli/clients/cli/commands/build-theme.adaptations.test.mjs: clear (passes).
  • packages/cli/clients/cli/commands/build-theme.color-scheme.test.mjs: clear (passes).
  • packages/core/src/theme/Theme.doc.mjs: clear.
  • packages/core/src/theme/Theme.tsx: clear.
  • packages/core/src/theme/__tests__/ThemeColorScheme.a11y.chromium.spec.ts: no case for a color-scheme meta (first finding).
  • packages/core/src/theme/useTheme.test.tsx: no case for a color-scheme meta (first finding).
  • packages/core/src/theme/useTheme.ts: first finding.
  • scripts/build-css.layers.test.mjs: clear (passes).
  • scripts/build-css.mjs: clear.

Automated review (maintainer link)

Comment thread packages/core/src/theme/useTheme.ts Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec bad02b3

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026

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

Approved pending CI. CI has not run on this head yet: its run was cancelled when CI was full, so it needs a re-run before merge.

The theme build change, and the #12247 commits it carries, match the record changes an engineering owner approved at this head. The earlier useTheme() color-scheme meta, @dark block and stack problems are fixed. A few non-blocking points:

  • Both changesets ship as a patch [fix] while giving apps without reset.css a migration. That is the owner's call. Even so, the Theme record's compatibility block still says "Released default preserved: yes" and "Migration decision: none", and it should name the outcome for apps without reset.css.
  • docs/specs/AST-080-package-stylesheets/spec.md:246 says the packages "already export" one stylesheet. Dropping "already" keeps project status out of the record.
  • The Stack: lines differ: #12247 lists #12247 → #12250, #12270. Making them identical lets the two pull requests be reviewed as one stack.
Claims and files checked

Review mode: full; reason: rebase

Claims (description):

  • Today, a page that loads a built theme stylesheet without reset.css follows a dark-mode reader: verified (base Chromium probe: root light dark, dark input, link and canvas).
  • Every built theme with light-dark() values writes the root rule, and a family build writes it on each member scope: verified (base build.mjs and family.mjs, base theme builds).
  • The fix removes only that rule and keeps the two forced-mode pins: verified (build.mjs:5738-5742, family.mjs:451-452).
  • The policy record gets an amended FR16 and a new decision, and the older decision keeps its text and decider: verified (AST-066 spec.md:298-320, :539, :547, :595-608).
  • Other output is unchanged; six official themes lose only the root line, and gothic is byte-identical: verified (all seven themes built on base and on the merged head).
  • In Chromium, a host with no scheme stays light for a dark reader after the change, and stays dark with reset.css or a forced dark root: verified (fixture probe; color-scheme browser spec).
  • The new setup cases keep the root at normal: verified against the code (a probe of the same page shape computes normal at this head); the cases themselves were not run here.
  • The setup cases pass on this stack: not run here (they install from the package registry, and CI was cancelled).
  • The theme build tests assert the pins and no light dark declaration: verified (all pass).
  • This pull request sits on #12247: verified (this head contains #12247's current head).

Claims (changesets):

  • Theme build no longer sets the page root's scheme, a family build drops the scope rule, and apps with reset.css see no change: verified.
  • A system Theme takes the page's scheme, and a host's dark root makes it dark: verified (browser spec).
  • useTheme() and useSyntaxTheme() report the same mode: light when the root names no scheme, the meta's scheme when one is set, the device's when both are named: verified (useTheme.ts:264-286, SyntaxTheme.tsx:99-101, browser spec).
  • reset.css makes the root follow the device, and Core's stylesheet sets no root scheme: verified (reset.css:388-390, built astryx.css).
  • A page with no scheme stays light, while a theme's own @dark styles still follow the device: verified (probe; generateThemeRules.ts:1480-1486).

Files:

  • .changeset/theme-build-follows-page-scheme.md: clear (non-blocking: patch [fix] with a migration, by the owner's decision).
  • .changeset/theme-system-follows-host-scheme.md: clear.
  • docs/architecture/theme-application.md: clear (owner-approved).
  • docs/architecture/theme-compilation.md: clear (owner-approved).
  • docs/specs/AST-066-theme-data-boundary/spec.md: clear (owner-approved).
  • docs/specs/AST-080-package-stylesheets/spec.md: non-blocking wording note at line 246.
  • docs/specs/components/theme/Theme.spec.md: clear (owner-approved; compatibility block noted above).
  • internal/vibe-tests/setup-test/setup-canonical.test.ts: clear (expectations match what this head draws).
  • internal/vibe-tests/setup-test/setup-integrity.mjs: clear (comment only).
  • packages/build/src/next.turbopack.test.mjs: clear.
  • packages/build/src/source-stylesheet.js: clear.
  • packages/build/src/source-stylesheet.test.mjs: clear (passes).
  • packages/cli/api/theme/build/build.family.test.mjs: clear (passes).
  • packages/cli/api/theme/build/build.mjs: clear.
  • packages/cli/api/theme/build/family.mjs: clear.
  • packages/cli/clients/cli/commands/build-theme.adaptations.test.mjs: clear (passes).
  • packages/cli/clients/cli/commands/build-theme.color-scheme.test.mjs: clear (passes).
  • packages/core/src/theme/Theme.doc.mjs: clear.
  • packages/core/src/theme/Theme.tsx: clear (comments only).
  • packages/core/src/theme/__tests__/ThemeColorScheme.a11y.chromium.spec.ts: clear (7 of 7 pass).
  • packages/core/src/theme/defineTheme.ts: clear.
  • packages/core/src/theme/useTheme.test.tsx: clear (passes).
  • packages/core/src/theme/useTheme.ts: clear (non-blocking: the file header repeats the hook's JSDoc).
  • scripts/build-css.layers.test.mjs: clear (passes).
  • scripts/build-css.mjs: clear.

Automated review (maintainer link)

Comment thread packages/core/src/theme/useTheme.ts Resolved
A built theme stylesheet declared :root { color-scheme: light dark; }, so a
host that loads it without reset.css, and names no scheme of its own,
followed the reader's device: for a dark reader its native controls, links
and canvas turned dark around its own light content. A theme now follows the
page's scheme. It keeps the html[data-theme="light"|"dark"] pins and the
media-surface flips; a --family build drops the per-scope light dark rule the
same way. reset.css, or the host's own color-scheme on html, is where an app
opts into following the device. AST-066 FR16 and DEC-7 state the two-pin
policy, and a canonical setup case measures a host with no scheme keeping it.
DEC-7 keeps its text and decider and names DEC-11, which replaces its root
rule. DEC-11 records that a theme follows the page's color scheme. The
current-state impact and the setup integrity note describe the two pins.
@josephfarina
josephfarina force-pushed the theme-build-page-scheme branch from bad02b3 to b30ec9e Compare November 18, 2026 03:45
@josephfarina
josephfarina marked this pull request as ready for review November 18, 2026 03:45
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec b30ec9e

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

Changes requested: the theme build change, its tests and the amended theme record all hold, and an engineering owner approved the record at this head. One sentence in the changeset is not accurate.

  • Miss: the changeset says "Apps that import reset.css see no change", but in the documented Tailwind setup an app that sets its own color-scheme on html in @layer base used to lose it to the theme's root rule and now keeps it, so its dark-mode readers see the page change; reword it, for example: "Apps whose page scheme comes only from reset.css see no change, while an app that sets its own color-scheme on html in a cascade layer below astryx-theme, such as Tailwind's base, now keeps that scheme instead of the theme's root rule."

Two non-blocking points: internal/vibe-tests/setup-test/PLAN.md:74 still describes the removed root rule, and the comment at packages/cli/api/theme/build/build.mjs:5708 still says the pins are emitted "also" so a Theme mode can "override" it.

Claims and files checked

Review mode: full; reason: rebase

Claims (description):

  • Before this change, a site that loads a built theme stylesheet without reset.css and sets no scheme of its own follows a dark reader: native inputs, links and canvas turn dark while its own coloured areas stay light: verified (Chromium probe on the base build).
  • Every built theme with light-dark() values writes the root rule, and a family build writes light dark on each member scope: verified (base build.mjs:5731, family.mjs:449).
  • Core's stylesheet already leaves the root scheme alone: verified (the head's Core stylesheet sets no root scheme).
  • The fix removes only that rule and keeps the pins for a forced mode: verified (build.mjs:5732-5736, family.mjs:451-452).
  • The theme record's FR16 is amended, a new decision records the policy, and the older decision keeps its text and decider and names the new one: verified (spec.md:300-319, :536-547, :595-608).
  • Media-surface flips, adaptations and every other output are unchanged: verified (base and head theme builds differ only in the root line).
  • Six official themes lose only the root line and gothic is byte-identical: verified (all seven built on base and head).
  • In Chromium, the page now stays light for a dark reader, and stays dark with reset.css or a forced dark root, as before: verified (probe; the forced-mode pins are unchanged).
  • The new setup case keeps the root at normal for light and dark readers: verified against the code (a probe of the same page computes normal at this head); the case itself was not run here.
  • The setup cases pass on main with this change: not run here (they install packages from the registry).
  • The theme build tests assert the two pins and no light dark anywhere: verified (they pass at this head and fail on the base).
  • No new public API: verified (the surface generator reports no rows).

Claims (changeset):

  • Theme build no longer sets the page root's scheme: verified.
  • Before, a host without reset.css and with no scheme followed the reader, its controls, links and canvas turning dark: verified (probe).
  • A theme still pins a forced mode, and a family build drops the scope rule: verified.
  • Apps that import reset.css see no change: false (an app with reset.css that sets its own color-scheme in Tailwind's base layer changes; probe).
  • To follow the device with theme CSS alone, add reset.css or html { color-scheme: light dark }: verified (probe with reset.css).

Files:

  • .changeset/theme-build-follows-page-scheme.md: blocking (the reset.css sentence).
  • docs/specs/AST-066-theme-data-boundary/spec.md: clear (owner-approved at this head; no decider line changed).
  • internal/vibe-tests/setup-test/setup-canonical.test.ts: clear (its expectations match a probe of the same page).
  • internal/vibe-tests/setup-test/setup-integrity.mjs: clear (comment only; PLAN.md:74 still describes the old output).
  • packages/cli/api/theme/build/build.family.test.mjs: clear (passes; fails on the base).
  • packages/cli/api/theme/build/build.mjs: clear (non-blocking: stale comment at 5708).
  • packages/cli/api/theme/build/family.mjs: clear.
  • packages/cli/clients/cli/commands/build-theme.adaptations.test.mjs: clear (passes; fails on the base).
  • packages/cli/clients/cli/commands/build-theme.color-scheme.test.mjs: clear (passes; fails on the base).

Automated review (maintainer link)

…re the root rule was named

The changeset says apps whose page scheme comes only from reset.css see no
change, and an app that sets its own color-scheme on html now keeps it. The
setup plan and the build's comment describe the two mode pins.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 7855f83

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

Approved pending CI: CI is still running on this head. The changeset sentence about reset.css apps is now accurate, the earlier notes on PLAN.md and the build comment are addressed, and an engineering owner approved the amended theme record at this head, so nothing else needs to change.

Claims and files checked

Review mode: incremental; reason: none

Claims (description):

  • Before this change, a site that loads a built theme stylesheet without reset.css and sets no scheme of its own follows a dark reader, its native inputs, links and canvas turning dark while its own coloured areas stay light: verified (Chromium probe on the base build).
  • Every built theme with light-dark() values writes the root rule, and a family build writes light dark on each member scope: verified (base build.mjs:5731, family.mjs:449); the rule opens the theme layer block rather than the whole stylesheet.
  • Core's stylesheet leaves the root scheme alone through a separate fix (#12247): verified (the head's Core stylesheet sets no root scheme).
  • The fix removes only that rule and keeps the pins for a forced mode: verified (build.mjs:5733-5737, family.mjs:451-452).
  • The theme record's FR16 is amended, a new decision records the policy, and the older decision keeps its text and decider and names the new one: verified (spec.md:300-319, :547, :595-608).
  • Media-surface flips, adaptations and every other output are unchanged: verified (base and head theme builds differ only in the root line).
  • Six official themes lose only the root line and gothic is byte-identical: verified (all seven built on base and head).
  • In Chromium the page now stays light for a dark reader and still follows the reader with reset.css: verified (probe); a forced dark root stays dark: verified from the unchanged pins.
  • The new setup case keeps the root at normal for light and dark readers with no host regression: verified against the code (a probe of the same page computes normal at this head); the case itself was not run here.
  • On main with this change, the four named setup cases pass: not run here (they install packages from the registry).
  • The three theme build test files assert the pins and no light dark in standalone and family output: verified (they pass at this head and fail on the base).
  • No new public API, default or interaction model hides under the fix label: verified (the API surface generator reports no rows).
  • The listed checks pass: verified for the theme build suites, Prettier, the changeset check, the record check and ESLint on the changed files, and CI's typecheck and lint jobs pass at this head; the theme editor, setup-integrity and setup-workspace suites were not run here, and CI's node test shards are still running.

Claims (changeset):

  • Theme build no longer sets the page root's scheme: verified.
  • Before, a host without reset.css and with no scheme of its own followed the reader, its controls, links and canvas turning dark: verified (probe).
  • A theme still pins a forced mode, and a family build drops the scope rule: verified.
  • Apps whose page scheme comes only from reset.css see no change: verified (base and head frames with reset.css are pixel-identical).
  • An app that sets its own color-scheme on html in its own layer, as the Tailwind setup does, now keeps it: verified (probe with reset.css and a light scheme in Tailwind's base layer: the root goes from light dark to light).
  • To follow the device with theme CSS alone, add reset.css or html { color-scheme: light dark }: verified (probe with reset.css).

Files:

  • .changeset/theme-build-follows-page-scheme.md: clear (the reset.css sentence is now accurate).
  • docs/specs/AST-066-theme-data-boundary/spec.md: clear (owner-approved at this head; no decider line changed).
  • internal/vibe-tests/setup-test/PLAN.md: clear (names the two pins).
  • internal/vibe-tests/setup-test/setup-canonical.test.ts: clear (its expectations match a probe of the same page).
  • internal/vibe-tests/setup-test/setup-integrity.mjs: clear (comment only).
  • packages/cli/api/theme/build/build.family.test.mjs: clear (passes; fails on the base).
  • packages/cli/api/theme/build/build.mjs: clear.
  • packages/cli/api/theme/build/family.mjs: clear.
  • packages/cli/clients/cli/commands/build-theme.adaptations.test.mjs: clear (passes; fails on the base).
  • packages/cli/clients/cli/commands/build-theme.color-scheme.test.mjs: clear (passes; fails on the base).

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 7658fcf into main Nov 18, 2026
80 checks passed
@github-actions
github-actions Bot deleted the theme-build-page-scheme branch November 18, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 7855f837 Deployed Nov 18, 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