Currently, I am implementing material-ui in my Reactjs project and have opted to use withStyles HOC for styling my components. However, I am facing an issue with translating complex CSS selectors to React Style.
const Styles ={
label :{
width:"100%"
},
cardInputRadio:{
display:"none",
'&:checked + .cardInput': {
color: 'green',
display:"block"
}
},
cardInput:{
margin:"10px",
'&:hover': {
cursor: 'pointer',
},
'cardInputRadio:checked+ &':{
color:'red',
}
},
container:{
flexGrow:1,
},
card: {
minWidth: 100,
width:300,
display:"inline-block"
},
title: {
fontSize: 14,
},
} ;
This is what I'm currently working on, utilizing the following approach:
export default withStyles(Styles)(MyComponent);
I am attempting to convert this CSS to react Style:
.card-input-element:checked + .card-input {
box-shadow: 0 0 1px 1px #2e0071;
}
The goal is to change the card's color when the radio button is checked, but it seems challenging with Material UI style HOC. Any suggestions would be greatly appreciated!