Allow for completely overriding (and/or disabling) the core dark: variant.
#11534
Replies: 3 comments 8 replies
-
|
If I'm not mistaken, simply moving |
Beta Was this translation helpful? Give feedback.
-
|
Another thought is something like what I've proposed here for the |
Beta Was this translation helpful? Give feedback.
-
|
Already possible: set |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I think it should be possible to write a completely custom
dark:variant, but right nowaddVariant('dark', /* ... */)does nothing (presumably because the coredark:definition is applied after custom variants are registered).My present motivation is making a "progressively enhanced" dark mode, where the base mechanism relies on
@media (prefers-color-scheme: dark), but where an attribute/class-based mechanism (with higher precedence) is added on top of that if JavaScript is enabled. The trouble is that the available configuration options fordark:aren't up to the task, and I can't override the coredark:variant with custom selectors. I could define a separate variant likedark-mode:that does what I want, but since I can't disabledark:, developers are bound to accidentally use the latter instead of the former.If the TW team were amenable to the idea, I might be able to find time to contribute here.
Beta Was this translation helpful? Give feedback.
All reactions