Answer the question
In order to leave comments, you need to log in
React classname dynamically change selector css value dynamically?
You need to change the color value but it's important that it be a selector to override other css and to apply this to all nested components.
The selector is like this:
s1.s1.s3 * {
color: green;
}
But you need to do it dynamically, so that the color changes according to the parameter, that is, you need to somehow select this selector in the code and edit the color value in it. Can this be done somehow without radium? Some native ways, or are there some other ways? I'm using scss *
I have a color selector, i.e. I move the slider and the color changes, I can't create many classes for each color. I need to insert a variable* And it's important that the selector be exactly like this,
also I can't use the style property. because this selector is needed
This is a colorpicker, I can't create classes with styles for all colors *
Answer the question
In order to leave comments, you need to log in
Add your color prefix to className / or pass the desired property to the style tag.
variable = this.state.color // например 's4'
...
<div className={'s1 s2 s3 ' + variable}> // не забывайте пробел после s3
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question