Repository navigation
fix: fix: theme flashes: share URL and applied visitor theme paint the default theme first - #619
Merged
Merged
Conversation
…618) Visitor theme and share URL now apply from a head-inline integration ahead of the bundled CSS, the studio hydrates from the URL state, setTokens beats a preset's dark block, the init script survives blocked storage, and a zero-flash matrix runs in the land gate when theme files change.
mvilacad
force-pushed
the
fix/618-fix-theme-flashes-share-url-and
branch
from
October 25, 2026 21:25
d6fbb5c to
6360da7
Compare
mvilacad
marked this pull request as ready for review
October 25, 2026 21:25
mvilacad
added a commit
that referenced
this pull request
Oct 25, 2026
mvilacad
added a commit
that referenced
this pull request
Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #618
Regression test (written first)
packages/ui/tests/theme-order.test.ts: in the BUILT HTML of each consumer path (Kit, Vite, Astro), every theme script (__caTheme,__caSiteBoot) comes before the first<style>/<link rel="stylesheet">. The same rule runs on every built site page insite/tests/dist-html.spec.ts.bun test packages/ui/tests/theme-order.test.ts, with only the test and the boot markup it imports added to a clean origin/main checkout):Change
The theme script ran behind ~700 KB of inlined CSS, so a slow link painted the default theme first.
caUInow emits the theme (and the site boot) first in<head>, before any stylesheet; storage-blocked and share-URL paths wear the target theme on first paint.Checklist
bun run validatepasses (pre-push)