Skip to content

A home-screen page's system bars follow the theme shown - #292

Merged
robertblust merged 1 commit into
mainfrom
theme-color-follows-theme
Oct 14, 2026
Merged

robertblust merged 1 commit into
mainfrom
theme-color-follows-theme

Conversation

@robertblust

Copy link
Copy Markdown
Owner

A page added to a phone's home screen has Android paint its system bars from the page's theme-color, and the family's pages declared none, so blust.ch opened from the home screen of a Pixel sat above a white navigation bar under a dark page. The theme block now keeps a page's theme-color meta on the --ground of the theme shown, read from the tokens rather than restated, when the page loads and whenever data-theme changes. It watches the attribute with a MutationObserver rather than hooking applyTheme, because blust.ch's pages switch the theme with a copy of their own, and the attribute is the one thing every switch sets. A page without the meta is left as it is, so nothing changes for a site until it declares one.

A page that declares viewport-fit=cover draws under the phone's bottom bar, so the footer's bottom padding adds env(safe-area-inset-bottom); on every other page the inset is 0 and the padding is the 2rem it was. The theme block goes to v6 and the footer to v4, and the docs map says both.

Both blocks are synced files, so this is a minor, and a site takes it with npm run design alone. The declarations that make use of it are each site's own head contract: blust.ch adds a web app manifest, its icons, the theme-color meta and viewport-fit=cover in a pull request that takes this release; companygraph.io and guestgraph.io can follow by hand. Release notes to write at tagging: a page's theme-color follows the theme shown, so a page opened from a phone's home screen has system bars in its own ground; the footer keeps clear of a phone's bottom bar on a page that draws under it.

Verified: npm test passes 1079 of 1079; the three new theme-color tests fail with the setter or the observer removed; conventions-check and conventions-format pass; on blust.ch served locally with these blocks, Chromium showed theme-color follow dark, light and dark on the home page, a talk and /model/, and light on arrival with ?theme=light, and blust.ch's npm run verify passed. Not verified on a phone: whether Android paints its bottom bar from it is seen only once blust.ch serves it.

🤖 Generated with Claude Code

A page added to a phone's home screen has Android paint its system bars from the page's theme-color, and the family's pages declared none, so blust.ch opened from the home screen sat above a white bar. The theme block now keeps a page's theme-color meta on the --ground of the theme shown, read from the tokens, when the page loads and whenever data-theme changes. It watches the attribute rather than hooking applyTheme, because blust.ch's pages switch the theme with a copy of their own and the attribute is the one thing every switch sets. A page without the meta is left as it is.

A page that declares viewport-fit=cover draws under the phone's bottom bar, so the footer's bottom padding adds env(safe-area-inset-bottom); everywhere else the inset is 0 and the padding is the 2rem it was. The theme block goes to v6 and the footer to v4.

Verified: npm test passes 1079 of 1079; the three new theme-color tests fail with the setter or the observer removed; conventions-check and conventions-format pass; on blust.ch served locally with these blocks, Chromium showed theme-color follow dark, light and dark on the home page, a talk and /model/, and light on arrival with ?theme=light, and npm run verify passed.

Process: Delivery
Phase: Implement
Track: Code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robertblust
robertblust merged commit 8c3e2b3 into main Oct 14, 2026
2 checks passed
@robertblust
robertblust deleted the theme-color-follows-theme branch October 14, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant