-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Restore old behavior for class
dark mode, add new selector
and variant
options for dark mode
#12717
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thecrypticace
force-pushed
the
feat/dark-mode-variant
branch
from
January 5, 2024 17:27
cf7d240
to
a18f96b
Compare
thecrypticace
changed the title
Restore old behavior for
Restore old behavior for Jan 5, 2024
darkMode: "class"
and add new darkMode: "selector"
optionclass
dark mode, add new selector
and variant
options for dark mode
thecrypticace
added a commit
that referenced
this pull request
Jan 5, 2024
…ariant` options for dark mode (#12717) * Add dark mode variant option * Tweak warning messages * Add legacy dark mode option * wip * Use `class` for legacy behavior, `selector` for new behavior * Add simplified failing apply/where test case * Switch to `where` list, apply changes to `dir` variants * Don’t let `:where`, `:is:`, or `:has` be attached to pseudo elements * Updating tests... * Finish updating tests * Remove `variant` dark mode strategy * Update types * Update comments * Update changelog * Revert "Remove `variant` dark mode strategy" This reverts commit 1852504. * Add variant back to types * wip * Update comments * Update tests * Rename variable * Update changelog * Update changelog * Update changelog * Fix CS --------- Co-authored-by: Adam Wathan <[email protected]>
This was referenced Sep 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we release v3.4 we changed
darkMode: "class"
to use:where
and changed the sort order so it does not have a higher specificity. This also makes it act the same asdarkMode: "media"
.Some projects depended heavily on the higher selector specificity rather than using variants to explicitly handle light vs dark mode, dark mode vs hover styles, etc… This made this a pretty large breaking change.
This PR does two things:
darkMode: "class"
works the way it did in v3.3. This includes the difference in sorting.darkMode: "selector"
which uses the new:where()
behavior and sort order and as such makes this change opt-in.Fixes #12633