-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Documentation out of date with Tailwind's new dark-mode API #250
Comments
You could just ... update the README.md? Might just update it if I figure it out 👿 |
I missed this before but looks like someone already has a proposal for the README.md update. Here is the commit I used to move from the |
I really don't care for this attitude @joshuawootonn. As you can see there is an open PR for the documentation changes (in the thread above your first comment). |
Fair enough. I was in a spicy late night mood. Not helpful especially since the maintainer isn't responding. Sorry y'all. Probably wouldn't have posted normally. It just felt like an easy change. Thanks for contributing the update though. Hope it get's merged soon! |
I also had to include a // On page load or when changing themes, best to add inline in `head` to avoid FOUC
document.documentElement.classList.toggle(
'dark',
localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
)
// Whenever the user explicitly chooses light mode
localStorage.theme = 'light'
// Whenever the user explicitly chooses dark mode
localStorage.theme = 'dark'
// Whenever the user explicitly chooses to respect the OS preference
localStorage.removeItem('theme') |
Tailwind recently changed their dark-mode API:
next-themes
README) still exists for backward-compatibility, and under the hood it still doesaddVariant('dark', `:is(${selector} &)`)
.addVariant('dark', `&:where(${selector}, ${selector} *)`)
.dark:
variant:addVariant('dark', selector)
.The new strategies aren't yet documented on the Tailwind website, but they were shipped in v. 3.4.1. (A slightly different version shipped in 3.4.0, but it had problems.)
The README for this repository should probably be updated accordingly.
The text was updated successfully, but these errors were encountered: