<input type=checkbox role=switch>
<input type=checkbox role=switch checked>
<input type=checkbox role=switch disabled>
<input type=checkbox role=switch disabled checked>
[type=checkbox][role=switch] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: radial-gradient(
circle at var(--position) 50%,
white 15%,
var(--border) 16%,
var(--color) 19%);
/* pimpin' start here */
--position: 20%;
--color: #DDD;
--border: #888;
width: 3em;
height: 1.5em;
border-radius: 1.5em;
box-shadow: 0 .1em .2em black inset;
}
[type=checkbox][role=switch]:checked {
--position: 80%;
--color: #4D0;/* or #48F in japan */
}
[type=checkbox][role=switch]:disabled{
opacity: .4;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.