• Stars
    star
    661
  • Rank 65,893 (Top 2 %)
  • Language Handlebars
  • License
    MIT License
  • Created over 12 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Accessible, CSS-only, toggle switches

CSS Toggle Switch

Build Status Downloads Get help on Codementor

CSS Toggle Switches are a set of accessible CSS-only switch components, created from standard form controls in the markup.

You can use them standalone, or with Bootstrap or Foundation.

Install

Download from the project page.

With Bower: bower install --save css-toggle-switch

With npm: npm install --save css-toggle-switch

From jsDelivr

<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/css-toggle-switch@latest/dist/toggle-switch.css" />

How to use it

Just include toggle-switch.css, and use the markup from the documentation.

Scaling

By default, the switches will scale along with the font size on their parent, because they're built using ems.

If you want to switches to scale using rems, you can include the toggle-switch-rem.css file (without including toggle-switch.css).

If you don't need the switches to scale at all, you can use the the toggle-switch-px.css file.

Switches

Light switch

Use the light switch, instead of a checkbox, for simple On/Off options.

Toggle switch

Use the toggle switches, instead of radio buttons, for two or more, specific options.

Browser support

The toggle switches work on all modern browsers, including mobile ones(even proxy-browsers like Opera Mini).

Browsers without support for media-queries, such as IE8 and bellow, get standard form elements.

The onclick="" attribute is required for older iOS and Opera Mini support.

Development

You'll need Grunt:

  grunt server

Then

  http://localhost:9000/

Don't use the gh-pages branch. It's used only for hosting the documentation website.

License

CSS Toggle Switch is a project by IonuΘ› Colceriu, licensed under the MIT license.

More Repositories

1

jotted

Environment for showcasing HTML, CSS and JavaScript, with editable source.
JavaScript
492
star
2

gridlayout

Lightweight grid system for advanced horizontal and vertical app layouts, with support for older browsers.
Handlebars
123
star
3

acornmediaplayer

Accessible and easily customizable HTML 5 media player, as a jQuery plugin.
JavaScript
106
star
4

angular-meditor

Simple floating text editor for Angular, inspired by Medium.
JavaScript
96
star
5

bizcardmaker

SCSS
50
star
6

righttasks

Browser extension for improved task management in Gmail
JavaScript
28
star
7

siloz.io

Private code playground in the browser
JavaScript
15
star
8

nudgeti

Don't waste time on distracting websites. A gentler alternative to website blockers.
JavaScript
14
star
9

actos-dashboard

KWin script for managing windows, apps and activities, for the KDE Plasma Desktop.
JavaScript
9
star
10

actos-soundmenu

Actos SoundMenu plasmoid for the KDE Plasma Desktop, controlling sound volume and music playback.
JavaScript
7
star
11

durruti

Micro Isomorphic JavaScript library for building user interfaces.
JavaScript
5
star
12

bluetooth-fxos

JavaScript
4
star
13

prajina

Micro url shortener for siloz.io
JavaScript
3
star
14

oxygenos

Oxygen Webos is a HTML/CSS/JavaScript interface for a web operating system.
JavaScript
2
star
15

passwordmaker-mobile

PasswordMaker for FirefoxOS.
JavaScript
2
star
16

bizcardmaker-api

API for bizcardmaker.com
JavaScript
1
star
17

ghinda.github.com

Personal website.
SCSS
1
star
18

chrome-webstore-ranking

Get some sense what's your extension's rating in certain categories in Chrome Webstore
JavaScript
1
star
19

cssoff2012

Friendly Markup Fisticuffs. My CSS Off 2012 entry.
CSS
1
star
20

actos-icontheme

Minimalist icon theme inspired by Android, part of Actos, for the KDE Plasma Desktop.
1
star
21

dotfiles

Shell
1
star
22

accordiongallery

Accordion Gallery is a lightweight jQuery plugin, providing a unique and innovative image gallery, with rich effects, semantic markup, and accessibility in mind.
CSS
1
star