Created
February 2, 2017 03:02
-
-
Save rwhitmire/4a838a67560ce4294bcfe9278ec00d26 to your computer and use it in GitHub Desktop.
styled checkboxes
This file contains 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
input[type=checkbox] { | |
outline: none; | |
position: relative; | |
} | |
input[type=checkbox]:after { | |
content: ' '; | |
display: inline-block; | |
width: 13px; | |
height: 13px; | |
background: #2e9aff; | |
border-radius: 3px; | |
position: absolute; | |
} | |
input[type=checkbox]:focus:before { | |
content: ' '; | |
display: inline-block; | |
width: 15px; | |
height: 15px; | |
border-radius: 3px; | |
position: absolute; | |
top: -2px; | |
left: -2px; | |
border-radius: 3px; | |
border: 1px solid #2e9aff; | |
} | |
input[type=checkbox]:checked:after { | |
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E"); | |
background-size: 60%; | |
background-position: 50%; | |
background-repeat: no-repeat; | |
} | |
input[type=checkbox]:indeterminate:after { | |
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E"); | |
background-size: 60%; | |
background-position: 50%; | |
background-repeat: no-repeat; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment