Skip to content

Keep the theme across ClientRouter navigation - #282

Merged
fulldev-release[bot] merged 3 commits into
mainfrom
fix/theme-client-router
Oct 15, 2026
Merged

fulldev-release[bot] merged 3 commits into
mainfrom
fix/theme-client-router

Conversation

@silveltman

@silveltman silveltman commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes the active Astro theme being reset by ClientRouter navigation. The provider carries the latest theme into the incoming document immediately at the actual swap, preserving changes made during the fallback animation and the existing swap callback contract. System preference, storage synchronization and toggle behavior stay intact.

Replaces #260 with a minimal fix against current main. Includes regenerated registry output and a patch changeset.

Validation: focused ClientRouter regressions pass in Chromium, Firefox and WebKit. The fallback regression fails with the previous implementation. Independent review also verified manual, system and storage changes during the fade, callback compatibility, back navigation and system reset. Native iOS Safari and Android Chrome smoke checks pass. Current Netlify preview registry matches this head; preview theme controls and navigation work. Required CI runs at Ready.

Astro's ClientRouter copies the next page's <html> attributes, which cannot
know the theme. ThemeProvider now carries the applied theme onto the next
page in astro:before-swap, so the theme no longer flashes and the class
observer no longer saves the server's light theme as the visitor's choice.

Replaces #260, which predates the system preference syncing on main.

Co-authored-by: El Mahdi Bennajah <bennajah.me@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for fulldev-ui ready!

Name Link
🔨 Latest commit 34ce7f6
🔍 Latest deploy log https://app.netlify.com/projects/fulldev-ui/deploys/6ad0b1f8fd8b7123dafd6acf
😎 Deploy Preview https://deploy-preview-282--fulldev-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@silveltman
silveltman marked this pull request as ready for review October 15, 2026 11:02
@fulldev-release
fulldev-release Bot merged commit 068e1e9 into main Oct 15, 2026
10 checks passed
@fulldev-release
fulldev-release Bot deleted the fix/theme-client-router branch October 15, 2026 11:04
@fulldev-release fulldev-release Bot mentioned this pull request Oct 15, 2026
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