Last active
April 13, 2021 12:00
-
-
Save tst32/611d3636caa49f83c32e34ded7b6fee7 to your computer and use it in GitHub Desktop.
Checkboxes - The first commented line is your dabblet’s title
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
/** | |
* Checkboxes - The first commented line is your dabblet’s title | |
*/ | |
.checkbox-on-off { | |
position: relative; | |
display: inline-block; | |
width: auto; | |
padding-right: 2px; | |
overflow: hidden; | |
vertical-align: middle; | |
margin-top: 10px; | |
} | |
.checkbox-on-off input[type=checkbox] { | |
position: absolute; | |
opacity: 0; | |
} | |
.checkbox-on-off input[type=checkbox]:checked+label { | |
background-color: lightblue; | |
} | |
.checkbox-on-off label { | |
display: inline-block; | |
border: 1px solid transparent; | |
height: 300px; | |
width: 300px; | |
background: #b8b8b8; | |
cursor: pointer; | |
border-radius: 20px; | |
} | |
.checkbox-on-off input[type=checkbox]:checked+label .checked { | |
display: inline-block; | |
margin-top: 0px; | |
margin-left: 0px; | |
background: no-repeat url('https://gist.githubusercontent.com/tst32/611d3636caa49f83c32e34ded7b6fee7/raw/9df9282b32b63c236e26e690aed8ada7db349173/bytile.svg'); | |
background-size: auto; | |
width: 100%; | |
height: 100%; | |
} | |
.checkbox-on-off label .checked { | |
display: none; | |
background: no-repeat url('https://gist.githubusercontent.com/tst32/611d3636caa49f83c32e34ded7b6fee7/raw/9df9282b32b63c236e26e690aed8ada7db349173/bylist.svg'); | |
} | |
.checkbox-on-off input[type=checkbox]:checked+label .unchecked { | |
display: none; | |
background: no-repeat url('https://gist.githubusercontent.com/tst32/611d3636caa49f83c32e34ded7b6fee7/raw/9df9282b32b63c236e26e690aed8ada7db349173/bytile.svg'); | |
} | |
.checkbox-on-off label .unchecked { | |
display: inline-block; | |
float: right; | |
padding-right: 3px; | |
} | |
.checkbox-on-off input[type=checkbox]:checked+label .toggle { | |
float: right; | |
} | |
.checkbox-on-off label .toggle { | |
float: left; | |
background: #fbfbfb; | |
height: 15px; | |
width: 13px; | |
border-radius: 20px; | |
} |
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
<!-- content to be placed inside <body>…</body> --> | |
<span class="checkbox-on-off "> | |
<input id="autoplay-checkbox" class="" type="checkbox" checked=""> | |
<label for="autoplay-checkbox" id="autoplay-checkbox-label"> | |
<span class="checked"> </span> | |
<span class="unchecked"></span> | |
<span class="toggle"> </span> | |
</label> | |
</span> | |
<span class="checkbox-on-off "> | |
<input id="autoplay-checkbox" class="" type="checkbox" checked=""> | |
<label for="autoplay-checkbox" id="autoplay-checkbox-label"> | |
<span class="checked"> </span> | |
<span class="unchecked"></span> | |
<span class="toggle"> </span> | |
</label> | |
</span> |
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
// alert('Hello world!'); |
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","fontsize":"90","seethrough":"1","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment