Last active
August 29, 2015 14:24
-
-
Save suzck/5ddd5b5943ecd1192aa5 to your computer and use it in GitHub Desktop.
How to style a custom checkbox in SCSS
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
<input type="checkbox" class="real-checkbox" name="checkbox" id="checkbox1" /> | |
<label for="checkbox1"><span class="fake-checkbox"> X </span>Crushing</label> |
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
.fake-checkbox { | |
font-size: 1.5em; | |
padding: .15em .45em; | |
background-color: #fff; | |
display: inline-block; | |
cursor: pointer; | |
} | |
.real-checkbox { | |
display:none; | |
+ label .fake-checkbox { | |
color: #fff; | |
} | |
&:checked { | |
+ label .fake-checkbox { | |
color: $secondary; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment