Is there a way to dynamically change the color of a specific selector in a React component? In my SCSS file, I have the following rule:
foo.bar.var * {
color: blue;
}
But I want to change this color to yellow, red, or something else in my React code.
I can't use the
style
property for the element because I need the selector to apply to all subchilds.
Are there any native ways to achieve this, or should I use Radium or similar libraries? Maybe CSS-Next could help with this?
I have a color picker, so I can't write class styles for every color.
For those who can provide an answer, please note:
I have a selector in an SCSS file that is imported in a root JS file with
.class * {color: $somecolor}
, and I need to change the $somecolor in that selector while picking colors in a color picker.
Is there a way to set a selector for all items nested inside the style
property, or is there a way to recursively apply CSS styles to every nested item from the style
prop?