Last active
August 29, 2015 14:07
-
-
Save dingledow/0bfe22b3d0001e4b3eaf to your computer and use it in GitHub Desktop.
Custom 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
<html> | |
<head> | |
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div className="checkbox"> | |
<input type="checkbox" id="select-all-checkbox" /> | |
<label htmlFor="select-all-checkbox">Select all</label> | |
</div> | |
</body> | |
</html> |
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
div.checkbox{ | |
input[type='checkbox'] { | |
height: 30px; | |
width: 30px; | |
border:1px solid #B5B7B8; | |
margin: 0; | |
background: #FFF; | |
border: 1px solid $sopost_k40; | |
outline: none; | |
color: white; | |
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); | |
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); | |
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); | |
-webkit-appearance: none; | |
-webkit-font-smoothing: antialiased; | |
-webkit-border-radius: 4px; | |
-moz-border-radius: 4px; | |
border-radius: 4px; | |
position: relative; | |
&:hover{ | |
border: 1px solid $sopost_k60; | |
cursor: pointer; | |
} | |
} | |
input[type='checkbox']:checked{ | |
position: relative; | |
border-color: darken($sopost_green, 20%); | |
} | |
input[type='checkbox']:checked:before{ | |
content: '\f00c'; | |
font-family: FontAwesome; | |
font-size: 21px; | |
padding: 3px 4px; | |
width: 28px; | |
height: 28px; | |
position: absolute; | |
top: 0; | |
left: 0; | |
background: none $sopost_green; | |
-webkit-border-radius: 3px; | |
-moz-border-radius: 3px; | |
border-radius: 3px; | |
} | |
label{ | |
position: absolute; | |
top: 0; | |
left: 27px; | |
min-width: 0 !important; | |
border-left: 0; | |
height: 30px; | |
padding: 4px 10px 6px 15px; | |
@include font-gotham; | |
color: $sopost_k40; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://astronautweb.co/snippet/font-awesome/
http://fortawesome.github.io/Font-Awesome/get-started/