CSS variables under non-media query conditions #488
Replies: 4 comments
-
|
Furthermore, if I try to use such a condition in a regular const styles = stylex.create({
root: {
color: "red",
":root[data-theme='dark']": {
color: "blue"
},
},Then this plugin generates code like this: @layer priority1 {
.1nrtymr {
color: red;
}
.xk6xt4:root[data-theme="dark"] {
color: blue;
}
} |
Beta Was this translation helpful? Give feedback.
-
|
Hi @wereHamster, Also, for a more detailed analysis, I would like to receive a link to a minimal reproduction of the problem. |
Beta Was this translation helpful? Give feedback.
-
|
https://github.com/wereHamster/stylex-root-condition
I expect the text to be blue, because the html element has a |
Beta Was this translation helpful? Give feedback.
-
|
I see that you have opened a similar discussion in the official repository as well. After the StyleX team finds a solution to this problem, I will also add it to this plugin. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I can use this pattern to re-define css variables under certain media query conditions:
however this does not seem to work if I try to use a condition like
:root[data-theme='dark']. The generated code is almost correct, but not quite:There's the extra
:rootthat prevents that CSS from working correctly. Is there any particular reason why the plugin generates that particular shape of CSS?Beta Was this translation helpful? Give feedback.
All reactions