Skip to content

Instantly share code, notes, and snippets.

@ianmcnally
Created July 16, 2014 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianmcnally/6f74ba8f1891131397bd to your computer and use it in GitHub Desktop.
Save ianmcnally/6f74ba8f1891131397bd to your computer and use it in GitHub Desktop.
A Pen by Ian McNally.
<div class="container">
<input type="checkbox" name="check-1" id="check-1"/>
<label for="check-1"></label>
</div>
.container
text-align: center
width: 100%
padding: 15px
input
display: none
label
display: block
height: 35px
width: 70px
background-color: white
border: 1px solid #eaeaea
transition: 2.5s all ease-in
border-radius: 15px
position: relative
&:after
content : ''
display: inline-block
background-color: white
border-radius: 15px
border: 1px solid grey
height: 30px
width: 30px
position: absolute
left: 0
top: 0
transform: translate3d(0, 0, 0)
margin-top: 1px
input:checked + label
background-color: #33CC00
&:after
transform: translate3d(100%, 0, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment