Created
December 5, 2016 18:50
-
-
Save pwFoo/6d0e679e437c874fc27466048f763fd7 to your computer and use it in GitHub Desktop.
input checkbox / radio font awesome support
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
/* hide default checkbox if checked */ | |
input[type='checkbox'].fa-replace:checked, | |
input[type='radio'].fa-replace:checked { | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
appearance: none; | |
border:none; | |
border-radius: 0; | |
} | |
/* use font awesome icon in pseudo before element */ | |
input[type='checkbox'].fa-replace:checked:before, | |
input[type='radio'].fa-replace:checked:before { | |
font-family: 'FontAwesome'; | |
content: attr(data-fa-icon); | |
} |
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
<!-- unicode list: http://fontawesome.io/cheatsheet/ --> | |
<input type="checkbox" name="checkbox-demo" id="checkbox-demo-1"> | |
<label for="checkbox-demo-1" class="fa-replace" data-fa-icon="">Label</label> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment