Last active
March 3, 2016 00:03
-
-
Save angusfretwell/1c9a95f101659e2783ca to your computer and use it in GitHub Desktop.
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
/*------------------------------------*\ | |
#SWITCH | |
\*------------------------------------*/ | |
/* | |
<label class="switch"> | |
<input type="checkbox" class="switch__checkbox" name="switch"> | |
<span class="switch__mask"></span> | |
</label> | |
*/ | |
.switch__checkbox { | |
display: none; | |
} | |
.switch__mask { | |
background-color: #fff; | |
border-radius: 100px; | |
border: 1px solid $base-ui-color; | |
cursor: pointer; | |
display: inline-block; | |
height: $base-spacing-unit * 1.5; | |
width: $base-spacing-unit * 3; | |
&:after { | |
background-color: $base-ui-color; | |
border-radius: 100px; | |
border: 3px solid #fff; | |
content: ""; | |
display: block; | |
height: 100%; | |
width: 50%; | |
transition: 250ms; | |
} | |
} | |
.switch__checkbox:checked + .switch__mask { | |
&:after { | |
transform: translateX(100%); | |
background-color: #9ACD77; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment