I'm trying to create a toggle switch by following this example in my React project. I'm using react-jss to help with the styling. I ran into an issue where the content style property with empty '' is not rendered on the page. This essentially creates the circle for the switch. I'm not sure what needs to be done here.
The style in question
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
In the stylesheet I'm setting it up like so
slider : {
'&:before' : {
position: 'absolute',
content: '',
height: '26px',
width: '26px',
top: '4px',
left: '4px',
bottom: '4px',
borderRadius : '50%',
backgroundColor : 'white',
'-webkit-transition': '0.4s',
transition: '0.4s'
}
}