A simple CSS on/off toggle switch checkbox.
A simple CSS on/off toggle switch checkbox. Uses before and :checked psuedo selectors and the content property to make just a plain old simple <input type="checkbox"> look nice, provide greater affordance, and say "on" and "off". It looks like this:
Download the production version or the development version.
In your web page:
<!doctype>
<html>
<head>
<link rel="stylesheet" href="mobilecheckbox.css">
</head>
<body>
<input type="checkbox">
</body>
</html>
Copyright (c) 2012 Boaz Sender
Licensed under the MIT, GPL licenses.
In lieu of a formal styleguide, take care to maintain the existing coding style. Lint your code using grunt and grunt-css.
Please don't edit files in the dist subdirectory as they are generated via grunt. You'll find source code in the src subdirectory!
This assumes you have node.js and npm installed already.
grunt --version at the command-line.npm install -g grunt to install the latest version. You may need to run sudo npm install -g grunt.npm install to install the project's dependencies.