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

Use Tailwind native way to customize selector: https://tailwindcss.co… #66

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

nlemoine
Copy link
Contributor

@nlemoine nlemoine commented Mar 7, 2023

Use Tailwind native way to customize selector: https://tailwindcss.com/docs/dark-mode#customizing-the-class-name

I'm fully aware this would be a breaking change but :

  • the plugin fails to generate variables when darkMode is set to an array in tailwind config because it is checking against strings (mode === 'class' || mode === 'media')
  • setting darkSelector feels redundant while the options is already available in Tailwind main config

@mertasan
Copy link
Owner

mertasan commented Mar 7, 2023

Thank you for noticing and contributing to this, Nicolas! Could you also update the English docs (README.md), please?

@mertasan mertasan merged commit 2e72ecb into mertasan:master Mar 7, 2023
@nlemoine nlemoine deleted the tailwind-dark-selector branch March 7, 2023 19:03
@nlemoine
Copy link
Contributor Author

nlemoine commented Mar 7, 2023

Thanks for merging this! I'll update the docs, just waited your approval first ;)

@mertasan
Copy link
Owner

mertasan commented Mar 8, 2023

This change was necessary. However, I didn't want to release a major version just for this change. Instead, I preferred to remove the darkSelector configuration from the documentation until the next major release and support it temporarily. The plugin primarily checks whether a selector is specified in the darkMode setting, and if no selector is defined, it considers the darkSelector or the default (.dark) value.

@nlemoine
Copy link
Contributor Author

nlemoine commented Mar 8, 2023

Sure, no problem! This a nice way to not introduce a breaking change and still support native Tailwind feature👌

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.

None yet

2 participants