Created
January 29, 2014 01:56
-
-
Save morningtoast/8680405 to your computer and use it in GitHub Desktop.
Styled inputs with glyphs
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
| // Works well on most current popular browsers. (Web fonts shakey on fringe browsers) | |
| .styled-input { | |
| input[type=radio] { | |
| display: none; | |
| &:checked + label:before { | |
| @include icon($icon-radio-checked); | |
| color: #000; | |
| } | |
| & + label { | |
| display: block; | |
| position: relative; | |
| padding-left: 2em; | |
| cursor: pointer; | |
| &:before { | |
| @include icon($icon-radio-unchecked); | |
| margin-right: 10px; | |
| position: absolute; | |
| top: 2px; | |
| left: 5px; | |
| color: #666; | |
| } | |
| } | |
| } | |
| input[type=checkbox] { | |
| display: none; | |
| &:checked + label:before { | |
| @include icon($icon-checkbox-checked); | |
| color: #000; | |
| } | |
| & + label { | |
| display: block; | |
| position: relative; | |
| padding-left: 2em; | |
| cursor: pointer; | |
| &:before { | |
| @include icon($icon-checkbox-unchecked); | |
| margin-right: 10px; | |
| position: absolute; | |
| top: 2px; | |
| left: 5px; | |
| color: #666; | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment