Skip to content

automatically detect browser theme (light/dark) (#1) #5

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rupali-yadav
Copy link

issue #1 :
window.matchMedia('(prefers-color-scheme: dark)') is used to determine whether the user has set their system or browser to dark mode.
A global theme context created using createContext now persists across routes by wrapping in the ThemeProvider.
Current theme can be read using --> const { theme, toggleTheme } = useContext(ThemeContext);

Copy link

vercel bot commented Dec 24, 2024

@rupali-yadav is attempting to deploy a commit to the Ansh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@anshaneja5
Copy link
Owner

anshaneja5 commented Dec 26, 2024

@rupali-yadav the changes are not propogated properly in all papers. for reference, you can check pages in light mode, its still dark. look into 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.

2 participants