Skip to content

Instantly share code, notes, and snippets.

@dziudek
Created August 3, 2012 21:41
Show Gist options
  • Save dziudek/3251777 to your computer and use it in GitHub Desktop.
Save dziudek/3251777 to your computer and use it in GitHub Desktop.
Simple animated CSS3 switcher
/**
* Simple animated CSS3 switcher
*/
label {
display: inline-block;
line-height: 24px;
}
.switcher {
display: inline-block;
position: relative;
width: 64px;
}
.switcher:before {
background: #f5f5f5;
border: 1px solid #ddd;
border-radius: 12px;
content: "";
display: inline-block;
height: 24px;
position: absolute;
top: -5px;
width: 64px;
}
.switcher:after {
background: #56f;
border-radius: 11px;
content: "";
display: block;
height: 22px;
left: 2px;
position: absolute;
top: -3px;
transition: left 0.3s ease-out;
width: 22px;
}
.switcher:checked:after {
left: 42px;
}
<!-- content to be placed inside <body>…</body> -->
<label>Use nice switchers: <input class="switcher" type="checkbox" value="0" /></label>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment