Skip to content

Instantly share code, notes, and snippets.

@jesusoterogomez
Last active August 29, 2015 14:16
Show Gist options
  • Save jesusoterogomez/91948cd53189119b5ca1 to your computer and use it in GitHub Desktop.
Save jesusoterogomez/91948cd53189119b5ca1 to your computer and use it in GitHub Desktop.
Atomic Switch
<input class="atomic switch" type="checkbox" name="atomic" checked>
body{
background:#222;
}
.atomic{
&.switch{
display:block;
width:54px;
height:26px;
position:relative;
/* display:none; */
visibility:hidden;
&:before{
display:block;
visibility:visible;
content:'';
width:100%;
border-radius:40px;
height:26px;
border:3px solid #FFF;
transition:all 0.3s ease;
}
&:after{
display:block;
content:'';
height:100%;
width:50%;
background:#FFF;
position:absolute;
visibility:visible;
margin:3px;
transform:scale(.75,.75);
left:0;
top:0;
border-radius:50%;
transition:all 0.3s ease;
}
&:checked:after{
left:50%;
background:orange;
}
&:checked:before{
border-color:orange;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment