Skip to content

claude driven dark mode#96

Open
ZachBeta wants to merge 6 commits intoRelistenNet:masterfrom
ZachBeta:dark-mode
Open

claude driven dark mode#96
ZachBeta wants to merge 6 commits intoRelistenNet:masterfrom
ZachBeta:dark-mode

Conversation

@ZachBeta
Copy link
Copy Markdown

@ZachBeta ZachBeta commented Oct 1, 2025

first draft of dark mode for #91

Comment thread src/app/layout.tsx Outdated
})();
`,
}}
/>
Copy link
Copy Markdown
Author

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

Copy link
Copy Markdown
Member

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

Comment thread src/components/ThemeToggle.tsx Outdated

// Update cookie and refresh server-side data
await setThemeCookie(newTheme);
router.refresh();
Copy link
Copy Markdown
Member

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

Comment thread src/lib/theme.ts

export type Theme = 'light' | 'dark';

export async function getTheme(): Promise<Theme | null> {
Copy link
Copy Markdown
Member

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)

@ZachBeta
Copy link
Copy Markdown
Author

ZachBeta commented Oct 1, 2025

will revisit again, ideally later today time permitting

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.

2 participants