Replies: 1 comment
-
First, let me say that using Now, let's consider the other issues you mentioned, which are essentially all about selectors.
|
Beta Was this translation helpful? Give feedback.
-
First, let me say that using Now, let's consider the other issues you mentioned, which are essentially all about selectors.
|
Beta Was this translation helpful? Give feedback.
-
I'm having a great time using StyleX, but many of the things I'm using is not following the guidelines.
For example look at this:
Here, I'm not supposed to use
:hover
,:is([data-disabled])
and setting and getting CSS vars like--trigger-icon-color
.Some of these are necessities, as I need to mirror the exact CSS from a component library.
Others, like the :hover are just much cleaner this way.
If I put 10 rules in a single :hover, why would I split them into 10 individual rules? The point of putting everything under :hover is to see exactly what's happening there. Like an if block in the source code. You don't write 10 if blocks with 1 line inside each, you write 1 if block with 10 lines inside.
:not(:last-child)
- I have no idea how would I do this without making the code way more complicated and trying to count this JS side, and then passing it on as props.What about
n-th child
? Do you implement a modulo function in a for loop and pass the result as props?At this point, I'm not sure I understand the philosophy behind StyleX. Why not allow these use cases?
They work great, but all these are not supposed to happen (as eslint is very enthusiastic to tell me).
How would you rewrite this to be more in line with the StyleX philosophy?
Beta Was this translation helpful? Give feedback.
All reactions