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 · 0 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 · 0 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
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.

2 participants