Replies: 1 comment
-
|
This is being addressed in #3497 which adds multi-block conditions using a declarative object syntax. Once merged, your dark mode use case would look like: conditions: {
extend: {
dark: {
'.dark &': '@slot',
'@media (prefers-color-scheme: dark)': {
'&:not(.light *)': '@slot',
},
},
},
}Usage stays the same: css({ _dark: { backgroundColor: 'gray.950' } })Generated CSS: .dark .dark\:bg_gray\.950 {
background-color: rgb(10, 10, 10);
}
@media (prefers-color-scheme: dark) {
.dark\:bg_gray\.950:not(.light *) {
background-color: rgb(10, 10, 10);
}
}No more duplicating token values across |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
PandaCSS currently supports mixed conditions that create nested selectors, but there's no way to generate multiple independent selectors from a single condition.
Current Behavior - Mixed Conditions
Generates:
Desired Behavior
Should generate:
Use Case
Dark mode that supports both system preferences and manual toggling without duplicating semantic token values:
Related
Beta Was this translation helpful? Give feedback.
All reactions