loading...

re: CSS Toggles/Switches VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Would you mind explaining a bit more how you would go about doing that?
 

Sorry for the late reply, was inactive for a while. Basically, the idea is to maintain the toggle on/off state with a hidden checkbox's built-in checked state, and use sibling selectors to style the UI.

Something in the lines of:

.chkbox + blah {
// styles for off UI
}
.chkbox:checked + blah {
// styles for on UI
}

Oh, that's a cool trick! Cheers!

code of conduct - report abuse