Last active
August 30, 2016 16:35
-
-
Save itwasmattgregg/55932559afcb871ba9d8253c76efc75f to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
<div class="checkbox"> | |
<input id="check1" type="checkbox"> | |
<label for="check1"><span>Test</span></label> | |
</div> |
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
// ---- | |
// Sass (v3.4.21) | |
// Compass (v1.0.3) | |
// ---- | |
.checkbox { | |
position: relative; | |
height: 30px; | |
margin-top: 20px; | |
input { | |
visibility: hidden; | |
&:checked + label:before { | |
content: ""; | |
height: 3px; | |
width: 12px; | |
background-color: green; | |
position: absolute; | |
left: 2px; | |
top: 11px; | |
border-radius: 5px; | |
transform: rotate(40deg); | |
z-index:2; | |
} | |
&:checked + label:after { | |
content: ""; | |
height: 24px; | |
width: 3px; | |
background-color: green; | |
border-radius: 15px; | |
position: absolute; | |
border: 2px solid #fff; | |
right: -1px; | |
top: -8px; | |
transform: rotate(30deg); | |
} | |
} | |
label { | |
height: 20px; | |
width: 20px; | |
position: absolute; | |
left: 0; | |
border: 3px solid #bbb; | |
line-height: 30px; | |
span { | |
position: relative; | |
padding-left: 35px; | |
vertical-align: top; | |
line-height: 20px; | |
} | |
} | |
} |
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
.checkbox { | |
position: relative; | |
height: 30px; | |
margin-top: 20px; | |
} | |
.checkbox input { | |
visibility: hidden; | |
} | |
.checkbox input:checked + label:before { | |
content: ""; | |
height: 3px; | |
width: 12px; | |
background-color: green; | |
position: absolute; | |
left: 2px; | |
top: 11px; | |
border-radius: 5px; | |
transform: rotate(40deg); | |
z-index: 2; | |
} | |
.checkbox input:checked + label:after { | |
content: ""; | |
height: 24px; | |
width: 3px; | |
background-color: green; | |
border-radius: 15px; | |
position: absolute; | |
border: 2px solid #fff; | |
right: -1px; | |
top: -8px; | |
transform: rotate(30deg); | |
} | |
.checkbox label { | |
height: 20px; | |
width: 20px; | |
position: absolute; | |
left: 0; | |
border: 3px solid #bbb; | |
line-height: 30px; | |
} | |
.checkbox label span { | |
position: relative; | |
padding-left: 35px; | |
vertical-align: top; | |
line-height: 20px; | |
} |
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
<div class="checkbox"> | |
<input id="check1" type="checkbox"> | |
<label for="check1"><span>Test</span></label> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment