Created
April 2, 2014 01:48
-
-
Save emiliorizzo/9926610 to your computer and use it in GitHub Desktop.
Checkbox Hack
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
/* Checkbox Hack */ | |
input[type=checkbox] { | |
display:none; | |
} | |
label { | |
display: inline-block; | |
cursor: pointer; | |
} | |
/* Default State */ | |
div { | |
display: none; | |
} | |
/* Toggled State */ | |
input[type=checkbox]:checked ~ div { | |
background: #e3f; | |
display:block; | |
} | |
:root input[type=checkbox]:checked + label{ | |
font-weight:bold; | |
} | |
:root input[type=checkbox]:checked + label:after{ | |
content: "<<"; | |
} | |
:root input[type=checkbox] + label:after{ | |
content: ">>"; | |
} | |
label:hover{ | |
color: #3bc; | |
font-weight:bold; | |
} |
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
<ol> | |
<li> | |
<input type="checkbox" id="toggle-1"> | |
<label for="toggle-1">I'm a toggle</label> | |
<div>I'm controlled by toggle. No JavaScript!</div> | |
</li> | |
<li> | |
<input type="checkbox" id="toggle-2"> | |
<label for="toggle-2">I'm a toggle</label> | |
<div> | |
I'm controlled by toggle. No JavaScript! | |
<a href="http://google.com" target="_blank">test</a> | |
</div> | |
</li> | |
</ol> |
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
{"view":"split-vertical","fontsize":"80","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment