-
Notifications
You must be signed in to change notification settings - Fork 26
claude driven dark mode #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
src/app/layout.tsx
Outdated
| })(); | ||
| `, | ||
| }} | ||
| /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is probably a better way to handle this but this avoids a flashbang on load so that it doesn't start light and quickly flip to dark
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should rely on the css value, rather than relying on javascript
src/components/ThemeToggle.tsx
Outdated
|
|
||
| // Update cookie and refresh server-side data | ||
| await setThemeCookie(newTheme); | ||
| router.refresh(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt be necessary (will cause some issues too) since you already are manually updating className
|
|
||
| export type Theme = 'light' | 'dark'; | ||
|
|
||
| export async function getTheme(): Promise<Theme | null> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will create a server action (since use server) which isn't necessary since its only called from the server.
setTheme can be a server action, but it should include validation (theme can only be light|dark)
|
will revisit again, ideally later today time permitting |
first draft of dark mode for #91