Save max-mapper/4263464 to your computer and use it in GitHub Desktop.
Save max-mapper/4263464 to your computer and use it in GitHub Desktop.
html5 checkbox toggle button
This demo overrides the default webkit-provided checkbox style by turning it off and making it transparent. Then it stretches the checkbox over the top of a custom designed button and uses a general sibling selector (~) to modify the style of the custom button whenever the checkbox toggles.
The benefit of this approach is that is is still semantically correct so it will serialize normally inside of a form, etc.
I also link to a stylesheet from my app gather.at that provides sprite images for the image assets in both 1x and 2x (retina) resolutions.
disclaimer: I have only tested this on webkit browsers (android 2.x+, ios 4.x+)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters