Last active
August 29, 2015 14:10
-
-
Save aj0strow/bbc4ed95624963041397 to your computer and use it in GitHub Desktop.
Switch Checkbox
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
.switch input { | |
display: none; | |
} | |
.switch i { | |
display: inline-block; | |
cursor: pointer; | |
padding-right: 20px; | |
transition: all ease 0.2s; | |
border-radius: 20px; | |
box-shadow: inset 0 0 1px rgba(0,0,0,.5); | |
} | |
.switch i:before { | |
display: block; | |
content: ''; | |
width: 20px; | |
height: 20px; | |
border-radius: 20px; | |
background: white; | |
box-shadow: 0 1px 2px rgba(0,0,0,.5); | |
} | |
.switch :checked + i { | |
padding-right: 0; | |
padding-left: 20px; | |
box-shadow: inset 0 0 1px rgba(0,0,0,.5), inset 0 0 40px lightblue; | |
} | |
.switch :disabled + i { | |
cursor: default; | |
opacity: 0.8; | |
} |
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
<!-- http://jsfiddle.net/ProLoser/bM4C9/ --> | |
<label class="switch"> | |
<input type="checkbox" checked> | |
<i></i> | |
</label> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment