I am attempting to apply the styles shown below in a React.js project, but I am unsure how to dynamically change the color based on a variable in React. Here is the code snippet:
CSS:
.toggle input:checked + .slider {
background-color: ${color};
}
React:
const { color } = userDoc.data()
return(
<div className="toggle">
<label className="switch">
<input type="checkbox" onChange={onChangeIsLve} checked={isActive}/>
<span className="slider round"></span>
</label>
</div>
)