Using the sibling selector together with props #3323
-
Yesterday, I ran into the following issue:
As long as two siblings have the same type, this works fine. But if type a and type. b are next to each other, the classes differ and the sibling selector is no longer applied. Normally in CSS, I would add a secondary class for the colors and use the class with the shared styles for the sibling selector. I know I can add a className to the Banner component and use that for the sibling selector, but it feels like a hack. Can I solve it in a better way, that matches more with the "Emotion" way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The usual answer is - don't do this. Don't introduce such contextual styles. However, if you really want this you can do this (when using our Babel plugin):
|
Beta Was this translation helpful? Give feedback.
The usual answer is - don't do this. Don't introduce such contextual styles.
However, if you really want this you can do this (when using our Babel plugin):