Skip to content

Disable light theme on login and device auth pages#3138

Merged
david-crespo merged 4 commits intomainfrom
benjaminleonard/disable-light-theme
Mar 19, 2026
Merged

Disable light theme on login and device auth pages#3138
david-crespo merged 4 commits intomainfrom
benjaminleonard/disable-light-theme

Conversation

@benjaminleonard
Copy link
Copy Markdown
Contributor

@benjaminleonard benjaminleonard commented Mar 19, 2026

Force dark mode on /login/ and /device/ routes by setting data-theme=dark on before first paint and at runtime. Keeps theme preference unaffected on other pages.

Fixes #3136

Upgrade design-system to 6.0.2--canary.167 for .dark class support, then force dark mode on /login/ and /device/ routes by setting data-theme=dark on <html> before first paint and at runtime. Keeps theme preference unaffected on other pages.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
console Ready Ready Preview Mar 19, 2026 6:53pm

Request Review

@david-crespo
Copy link
Copy Markdown
Collaborator

david-crespo commented Mar 19, 2026

I’m going to see if there’s a way to do this on the pages in question rather than in the store. But it might introduce a flash or delay, in which case we’re stuck with this version.

@benjaminleonard
Copy link
Copy Markdown
Contributor Author

I tried that first — and introduced a .dark override class. But the background and a few other parts are defined at a html level.

Alternatively, we just make the page work in light mode. But the lack of a toggle here might be weird.

@david-crespo david-crespo marked this pull request as ready for review March 19, 2026 18:35
await expect(page.locator('html')).toHaveAttribute('data-theme', 'dark')
}
})
})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@david-crespo
Copy link
Copy Markdown
Collaborator

I tried the route handle approach but I realized there's no point because the theme-init logic cannot rely on that because it runs before the router exists. So if we're stuck looking at path prefixes there, we should do by path prefix everywhere. I rewrote the code so it's more obviously identical.

@david-crespo david-crespo merged commit 1ea8ca0 into main Mar 19, 2026
7 checks passed
@david-crespo david-crespo deleted the benjaminleonard/disable-light-theme branch March 19, 2026 19:02
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.

Probably don't do light mode on login

2 participants