Skip to content
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

Open
MichaelAllenWarner opened this issue Feb 6, 2024 · 4 comments · May be fixed by #290
Open

Documentation out of date with Tailwind's new dark-mode API #250

MichaelAllenWarner opened this issue Feb 6, 2024 · 4 comments · May be fixed by #290
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@MichaelAllenWarner
Copy link

Tailwind recently changed their dark-mode API:

  • The default "media" strategy remains unchanged.
  • The "class" strategy (mentioned in the next-themes README) still exists for backward-compatibility, and under the hood it still does addVariant('dark', `:is(${selector} &)`).
  • The new "selector" strategy is meant to replace the "class" strategy going forward. It behaves similarly, but it has reduced specificity and is a little more flexible: addVariant('dark', `&:where(${selector}, ${selector} *)`).
  • The new "variant" strategy allows for total customization of the 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.

@trm217 trm217 self-assigned this May 2, 2024
@trm217 trm217 added the documentation Improvements or additions to documentation label May 2, 2024
@trm217 trm217 linked a pull request May 2, 2024 that will close this issue
@trm217 trm217 linked a pull request May 2, 2024 that will close this issue
@joshuawootonn
Copy link

You could just ... update the README.md?

Might just update it if I figure it out 👿

@joshuawootonn
Copy link

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 media strategy to the selector strategy with this library if this can help anyone.

@trm217
Copy link
Collaborator

trm217 commented Aug 22, 2024

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).
Paco (the code-owner) has been unreaponsive for many months and thus no changes/fixes have been merged for quite some time, as they'd need his approval.

@joshuawootonn
Copy link

joshuawootonn commented Aug 22, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants