Skip to content

fix: fall back to a real theme when data-theme is unknown - #40

Open
thejesh23 wants to merge 1 commit into
Nutlope:mainfrom
thejesh23:fix/invalid-theme-fallback
Open

fix: fall back to a real theme when data-theme is unknown#40
thejesh23 wants to merge 1 commit into
Nutlope:mainfrom
thejesh23:fix/invalid-theme-fallback

Conversation

@thejesh23

Copy link
Copy Markdown

Fixes #38

The theme resolver's last fallback read root.dataset.theme back, which the pre-paint script had already set from an unvalidated ?theme= / localStorage value. The bad value survived and was persisted, leaving the picker desynced on every later visit.

Validates the attribute against THEMES before using it, so an unknown value lands on hum and self-heals stale storage.

Verified locally:

  • /?theme=totally-not-a-themedata-theme="hum", storage "hum", Hum dot pressed
  • stale localStorage entry → corrected on next load
  • /?theme=carnival → unchanged (Carnival, 18 / 20, marquee hero)

An unrecognised ?theme= value (or a stale localStorage entry) passed the
resolver untouched and was written back to storage, so the picker stayed
desynced on every later visit. Validate the attribute against THEMES.
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

@thejesh23 is attempting to deploy a commit to the Together AI Team on Vercel.

A member of the Team first needs to authorize it.

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.

Unknown ?theme= value sticks permanently and desyncs the theme picker

1 participant