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

Suggestion: use :not(.is-dark) as lightSelector by default #35

Open
aletorrado opened this issue Apr 21, 2024 · 2 comments
Open

Suggestion: use :not(.is-dark) as lightSelector by default #35

aletorrado opened this issue Apr 21, 2024 · 2 comments

Comments

@aletorrado
Copy link
Contributor

Hi,

This is a very subjective matter, but I wanted to suggest you for the sake of simplicity, to just use a negated :not(.is-dark) selector as the default lightSelector. Even, the plugin may compute something like :not(<darkSelector>), so that the user can safely override darkSelector preserving the same behavior.

Using a single class or attribute seems like a good idea to simplify JS manipulation and avoid invalid states if by any means both is-light and is-dark are triggered.

If you agree with this, I would be glad to submit a PR.

Thanks!

@ai
Copy link
Member

ai commented Apr 21, 2024

Theme has 3 states: force light, force dark, and system theme.

You can't do 3 state with 1 class. So in CSS mode we need 2 classes and :not() will not see a difference between light and system theme.

@aletorrado
Copy link
Contributor Author

You're totally correct. This only makes sense with the preserve: false functionality that I proposed.

Thanks

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

No branches or pull requests

2 participants