Public: anyone can read this; nobody can change it.

Boot style follows data-theme so a theme toggle repaints the ground #32

Merged opened this view on origin

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

Mason's fix for the fork's #1240, carried upstream as written (fork pull #1241, commit 9e44960e), reviewed by the owner's steward.

shipped merged

opened this view on origin

Mason's fix for the fork's #1240, carried upstream as written (fork pull #1241, commit 9e44960e), reviewed by the owner's steward.

The owner: "the background isn't changing with the theme change anymore… it requires a refresh."

The nonce'd boot style painted the ground from the theme the server saw, or from the OS: html,body{background-color:…} plus a prefers-color-scheme media rule. The theme menu flips data-theme on the root without a reload, and nothing in the boot style looked at it, so the ground stayed put until the next full render.

The boot style is one constant for every page: the system pair, then one html[data-theme="…"],html[data-theme="…"] body rule per theme, which outranks the media rule. A toggle repaints at once; a page rendered with a chosen theme paints right on first frame because the root carries the attribute from the server.

Tests: test/themes.test.ts (the boot css has a rule per theme and the system pair) and test/web.test.ts updated for the constant.

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs