0

I need to select previous sibling. And to do that I am referring to this link. https://dev.to/ritvikdubey27/sibling-selectors-in-css-33k

This the code snippet:

 p:hover ? h1 {
    font-size: 30px;
    color: red;
 }

It is working fine in CSS but when I add it to my react project with SCSS support, it is not working. And I am not able to find any documentation or reference link to fix this.

Any help would be highly appreciated.

Rahul
  • 5,346
  • 5
  • 32
  • 87

1 Answers1

0

My guess is that react's scss compiler doesn't recognize the ? selector so it discards it.
Try to first compile the scss manually without the ? selector (to avoid errors) and then add it to the compiled css and use it as regular css.
and of course add <script src="https://rouninmedia.github.io/axe/axe.js"></script> for axe support.

ATP
  • 2,025
  • 2
  • 9
  • 24