Skip to content

Instantly share code, notes, and snippets.

@angusfretwell
Last active March 3, 2016 00:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angusfretwell/1c9a95f101659e2783ca to your computer and use it in GitHub Desktop.
Save angusfretwell/1c9a95f101659e2783ca to your computer and use it in GitHub Desktop.
/*------------------------------------*\
#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