CSS3 UISwitch
A pretty sweet and pure CSS3 iOS 7 UISwitch.
See it in action!
Grab it
npm
npm install uiswitch
Bower
bower install uiswitch
Unpkg
Use it
CSS
The switch is very easy to customize. Using plain vanilla CSS it's just a matter of subclassing. Start styling your custom switch
/* Active Background Tint (when pressed and hold) */ /* Background Tint */ /* Knob Tint */ /* Checked background tint */
and your HTML would be something like this
Sass
It's even easier with Sass. The class .uiswitch
is provided out of the box but is also provided with a mixin and an extend (if you really want to customize it)
You can change the global style for all uiswitch
classes with the following variables:
;; ;;;; ;;;
If you'd like to create a custom class based on a switch:
.my-switch
And if you want to customize it even further you can extend the %uiswitch
:
.my-switch