You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see above i have pretty simple Button component with some basic styling and I also use adjacent sibling selector to add some styles if next component is also a Button component. But as you can see on the image below, & + & selector does not work when the next Button component also uses css prop. In my example buttons 2 and 3 should have red background color, but third button doesn't have it because it has its own css prop;
The text was updated successfully, but these errors were encountered:
I have also failed to find a good solution to this problem. How about if emotion detected if className that is passed to the JSX function is a emotion class and uses that to merge with the css prop?
This is unsolvable because of the reasons mentioned in #1417 . You just think that & is something different than it actually is. A selector such as this in your emotion styles is thus unsafe.
emotion
version:@emotion/babel-preset-css-prop: 10.0.9
@emotion/core: 10.0.10
@emotion/styled: 10.0.10
react
version: 16.8.6Relevant code:
Problem description:
As you can see above i have pretty simple Button component with some basic styling and I also use adjacent sibling selector to add some styles if next component is also a Button component. But as you can see on the image below,
& + &
selector does not work when the next Button component also uses css prop. In my example buttons 2 and 3 should have red background color, but third button doesn't have it because it has its owncss
prop;The text was updated successfully, but these errors were encountered: