#Changing Switch component Styles doesn't work
7 messages · Page 1 of 1 (latest)
It should probably be backgroundColor instead of background.
You can probably right-click, inspect element to figure out which selectors to target.
you're using &:checked on the track but it would never have that property
I haven't test it, but you want to target input:checked then track
styles={{
input: {
'&:checked': {
'+ .mantine-Switch-track': {
backgroundColor: 'red'
}
}
}}}```
or
input: {
'&:checked + .mantine-Switch-track': {
backgroundColor: 'red'
}```
^ these are tested and work