/*! slidr.css - v0.1.0 - 2013-02-07 * https://github.com/tstachl/slidr.css * Copyright (c) 2013 Thomas Stachl; Licensed MIT */ /** * Slidr.css replaces checkboxes with slidrs in pure CSS. * * @see https://github.com/tstachl/slidr.css * @see https://tstachl.github.com/slidr * @license MIT (https://github.com/tstachl/slidr.css/blob/master/LICENSE) */ input[type="checkbox"] ~ span.slidr { position: relative; display: inline-block; height: 26px; width: 75px; top: 5px; line-height: 26px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; } input[type="checkbox"] ~ span.slidr::before { content: attr(data-off); position: absolute; top: 0; left: 0; bottom: 0; right: 0; background-color: #cfcfcf, #f0f0f0; background-image: -moz-linear-gradient(top, #dddddd, #bbbbbb), -moz-linear-gradient(top, #e6e6e6, white); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#dddddd), to(#bbbbbb)), -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(white)); background-image: -webkit-linear-gradient(top, #dddddd, #bbbbbb), -webkit-linear-gradient(top, #e6e6e6, white); background-image: -o-linear-gradient(top, #dddddd, #bbbbbb), -o-linear-gradient(top, #e6e6e6, white); background-image: linear-gradient(to bottom, #dddddd, #bbbbbb), linear-gradient(to bottom, #e6e6e6, white); background-repeat: no-repeat, no-repeat; filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFDDDDDD', endColorstr='#FFBBBBBB', GradientType=0)"; background-size: 75px 26px, 75px 26px; background-position: -75px 0, 0 0; border: 1px solid #cccccc; -webkit-border-radius: 13px; -moz-border-radius: 13px; border-radius: 13px; -webkit-transition: background-position 0.1s ease-in-out; -moz-transition: background-position 0.1s ease-in-out; -o-transition: background-position 0.1s ease-in-out; transition: background-position 0.1s ease-in-out; padding: 0 5px 0 26px; outline: none; overflow: hidden; cursor: pointer; font-weight: bold; text-align: center; } input[type="checkbox"] ~ span.slidr.slidr-info::before { background-color: #49afcd, #f0f0f0; background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4), -moz-linear-gradient(top, #e6e6e6, white); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)), -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(white)); background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4), -webkit-linear-gradient(top, #e6e6e6, white); background-image: -o-linear-gradient(top, #5bc0de, #2f96b4), -o-linear-gradient(top, #e6e6e6, white); background-image: linear-gradient(to bottom, #5bc0de, #2f96b4), linear-gradient(to bottom, #e6e6e6, white); background-repeat: no-repeat, no-repeat; filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF5BC0DE', endColorstr='#FF2F96B4', GradientType=0)"; } input[type="checkbox"] ~ span.slidr.slidr-success::before { background-color: #5bb65b, #f0f0f0; background-image: -moz-linear-gradient(top, #62c462, #51a351), -moz-linear-gradient(top, #e6e6e6, white); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)), -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(white)); background-image: -webkit-linear-gradient(top, #62c462, #51a351), -webkit-linear-gradient(top, #e6e6e6, white); background-image: -o-linear-gradient(top, #62c462, #51a351), -o-linear-gradient(top, #e6e6e6, white); background-image: linear-gradient(to bottom, #62c462, #51a351), linear-gradient(to bottom, #e6e6e6, white); background-repeat: no-repeat, no-repeat; filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF62C462', endColorstr='#FF51A351', GradientType=0)"; } input[type="checkbox"] ~ span.slidr.slidr-warning::before { background-color: #f9a937, #f0f0f0; background-image: -moz-linear-gradient(top, #fbb858, #f89406), -moz-linear-gradient(top, #e6e6e6, white); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb858), to(#f89406)), -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(white)); background-image: -webkit-linear-gradient(top, #fbb858, #f89406), -webkit-linear-gradient(top, #e6e6e6, white); background-image: -o-linear-gradient(top, #fbb858, #f89406), -o-linear-gradient(top, #e6e6e6, white); background-image: linear-gradient(to bottom, #fbb858, #f89406), linear-gradient(to bottom, #e6e6e6, white); background-repeat: no-repeat, no-repeat; filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFBB858', endColorstr='#FFF89406', GradientType=0)"; } input[type="checkbox"] ~ span.slidr.slidr-danger::before { background-color: #da4e49, #f0f0f0; background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f), -moz-linear-gradient(top, #e6e6e6, white); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)), -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(white)); background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f), -webkit-linear-gradient(top, #e6e6e6, white); background-image: -o-linear-gradient(top, #ee5f5b, #bd362f), -o-linear-gradient(top, #e6e6e6, white); background-image: linear-gradient(to bottom, #ee5f5b, #bd362f), linear-gradient(to bottom, #e6e6e6, white); background-repeat: no-repeat, no-repeat; filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEE5F5B', endColorstr='#FFBD362F', GradientType=0)"; } input[type="checkbox"] ~ span.slidr.slidr-inverse::before { background-color: #363636, #f0f0f0; background-image: -moz-linear-gradient(top, #444444, #222222), -moz-linear-gradient(top, #e6e6e6, white); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)), -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(white)); background-image: -webkit-linear-gradient(top, #444444, #222222), -webkit-linear-gradient(top, #e6e6e6, white); background-image: -o-linear-gradient(top, #444444, #222222), -o-linear-gradient(top, #e6e6e6, white); background-image: linear-gradient(to bottom, #444444, #222222), linear-gradient(to bottom, #e6e6e6, white); background-repeat: no-repeat, no-repeat; filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF444444', endColorstr='#FF222222', GradientType=0)"; } input[type="checkbox"] ~ span.slidr::after { content: ''; position: absolute; width: 24px; height: 24px; left: 0; -webkit-transition: left 0.1s ease-in-out; -moz-transition: left 0.1s ease-in-out; -o-transition: left 0.1s ease-in-out; transition: left 0.1s ease-in-out; background-color: #f5f5f5; background-image: -moz-linear-gradient(top, white, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(white), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, white, #e6e6e6); background-image: -o-linear-gradient(top, white, #e6e6e6); background-image: linear-gradient(to bottom, white, #e6e6e6); background-repeat: repeat-x; filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFE6E6E6', GradientType=0)"; border: 1px solid #999999; -webkit-border-radius: 13px; -moz-border-radius: 13px; border-radius: 13px; } input[type="checkbox"]:checked ~ span.slidr::before { content: attr(data-on); color: white; padding: 0 26px 0 5px; background-position: 0 0, 75px 0; } input[type="checkbox"]:checked ~ span.slidr::after { left: 50px; }