Blame progit/static/toggle.css

Johan Cwiklinski ab027f
/*
Johan Cwiklinski ab027f
 * Copyright (c) 2012-2013 Thibaut Courouble
Johan Cwiklinski ab027f
 * http://www.cssflow.com
Johan Cwiklinski ab027f
 *
Johan Cwiklinski ab027f
 * Licensed under the MIT License:
Johan Cwiklinski ab027f
 * http://www.opensource.org/licenses/mit-license.php
Johan Cwiklinski ab027f
 */
Johan Cwiklinski ab027f
Pierre-Yves Chibon dcf26d
label {
Pierre-Yves Chibon dcf26d
 margin:0;
Pierre-Yves Chibon dcf26d
 padding:0;
Pierre-Yves Chibon dcf26d
}
Pierre-Yves Chibon dcf26d
Johan Cwiklinski ab027f
.switch {
Johan Cwiklinski ab027f
  position: relative;
Pierre-Yves Chibon dcf26d
  display: inline-block;
Pierre-Yves Chibon dcf26d
  vertical-align: top;
Pierre-Yves Chibon dcf26d
  width: 75px;
Pierre-Yves Chibon dcf26d
  height: 20px;
Pierre-Yves Chibon dcf26d
  padding: 3px;
Pierre-Yves Chibon dcf26d
  background-color: white;
Pierre-Yves Chibon dcf26d
  border-radius: 18px;
Pierre-Yves Chibon dcf26d
  box-shadow: inset 0 -1px white, inset 0 1px 1px rgba(0, 0, 0, 0.05);
Pierre-Yves Chibon dcf26d
  cursor: pointer;
Pierre-Yves Chibon dcf26d
  background-image: -webkit-linear-gradient(top, #eeeeee, white 25px);
Pierre-Yves Chibon dcf26d
  background-image: -moz-linear-gradient(top, #eeeeee, white 25px);
Pierre-Yves Chibon dcf26d
  background-image: -o-linear-gradient(top, #eeeeee, white 25px);
Pierre-Yves Chibon dcf26d
  background-image: linear-gradient(to bottom, #eeeeee, white 25px);
Johan Cwiklinski ab027f
}
Johan Cwiklinski ab027f
Pierre-Yves Chibon dcf26d
.switch-input {
Pierre-Yves Chibon dcf26d
  position: absolute;
Pierre-Yves Chibon dcf26d
  top: 0;
Pierre-Yves Chibon dcf26d
  left: 0;
Pierre-Yves Chibon dcf26d
  opacity: 0;
Johan Cwiklinski ab027f
}
Johan Cwiklinski ab027f
Johan Cwiklinski ab027f
.switch-label {
Johan Cwiklinski ab027f
  position: relative;
Pierre-Yves Chibon dcf26d
  display: block;
Pierre-Yves Chibon dcf26d
  height: inherit;
Pierre-Yves Chibon dcf26d
  font-size: 10px;
Pierre-Yves Chibon dcf26d
  text-transform: uppercase;
Pierre-Yves Chibon dcf26d
  background: #eceeef;
Pierre-Yves Chibon dcf26d
  border-radius: inherit;
Pierre-Yves Chibon dcf26d
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12), inset 0 0 2px rgba(0, 0, 0, 0.15);
Pierre-Yves Chibon dcf26d
  -webkit-transition: 0.15s ease-out;
Pierre-Yves Chibon dcf26d
  -moz-transition: 0.15s ease-out;
Pierre-Yves Chibon dcf26d
  -o-transition: 0.15s ease-out;
Pierre-Yves Chibon dcf26d
  transition: 0.15s ease-out;
Pierre-Yves Chibon dcf26d
  -webkit-transition-property: opacity background;
Pierre-Yves Chibon dcf26d
  -moz-transition-property: opacity background;
Pierre-Yves Chibon dcf26d
  -o-transition-property: opacity background;
Pierre-Yves Chibon dcf26d
  transition-property: opacity background;
Johan Cwiklinski ab027f
}
Johan Cwiklinski ab027f
Pierre-Yves Chibon dcf26d
.switch-label:before, .switch-label:after {
Pierre-Yves Chibon dcf26d
  position: absolute;
Pierre-Yves Chibon dcf26d
  top: 50%;
Pierre-Yves Chibon dcf26d
  margin-top: -.5em;
Pierre-Yves Chibon dcf26d
  line-height: 1;
Pierre-Yves Chibon dcf26d
  -webkit-transition: inherit;
Pierre-Yves Chibon dcf26d
  -moz-transition: inherit;
Pierre-Yves Chibon dcf26d
  -o-transition: inherit;
Pierre-Yves Chibon dcf26d
  transition: inherit;
Johan Cwiklinski ab027f
}
Johan Cwiklinski ab027f
Pierre-Yves Chibon dcf26d
.switch-label:before {
Pierre-Yves Chibon dcf26d
  content: attr(data-off);
Pierre-Yves Chibon dcf26d
  right: 11px;
Pierre-Yves Chibon dcf26d
  color: #aaa;
Pierre-Yves Chibon dcf26d
  text-shadow: 0 1px rgba(255, 255, 255, 0.5);
Johan Cwiklinski ab027f
}
Johan Cwiklinski ab027f
Pierre-Yves Chibon dcf26d
.switch-label:after {
Pierre-Yves Chibon dcf26d
  content: attr(data-on);
Pierre-Yves Chibon dcf26d
  left: 11px;
Pierre-Yves Chibon dcf26d
  color: white;
Pierre-Yves Chibon dcf26d
  text-shadow: 0 1px rgba(0, 0, 0, 0.2);
Pierre-Yves Chibon dcf26d
  opacity: 0;
Johan Cwiklinski ab027f
}
Pierre-Yves Chibon dcf26d
Pierre-Yves Chibon dcf26d
.switch-input:checked ~ .switch-label {
Pierre-Yves Chibon dcf26d
  background: #3b6eb4;
Pierre-Yves Chibon dcf26d
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), inset 0 0 3px rgba(0, 0, 0, 0.2);
Johan Cwiklinski ab027f
}
Johan Cwiklinski ab027f
Pierre-Yves Chibon dcf26d
.switch-input:checked ~ .switch-label:before {
Pierre-Yves Chibon dcf26d
  opacity: 0;
Pierre-Yves Chibon dcf26d
}
Johan Cwiklinski ab027f
Pierre-Yves Chibon dcf26d
.switch-input:checked ~ .switch-label:after {
Pierre-Yves Chibon dcf26d
  opacity: 1;
Pierre-Yves Chibon dcf26d
}
Johan Cwiklinski ab027f
Pierre-Yves Chibon dcf26d
.switch-handle {
Pierre-Yves Chibon dcf26d
  position: absolute;
Pierre-Yves Chibon dcf26d
  top: 4px;
Pierre-Yves Chibon dcf26d
  left: 4px;
Pierre-Yves Chibon dcf26d
  width: 18px;
Pierre-Yves Chibon dcf26d
  height: 18px;
Pierre-Yves Chibon dcf26d
  background: white;
Pierre-Yves Chibon dcf26d
  border-radius: 10px;
Pierre-Yves Chibon dcf26d
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
Pierre-Yves Chibon dcf26d
  background-image: -webkit-linear-gradient(top, white 40%, #f0f0f0);
Pierre-Yves Chibon dcf26d
  background-image: -moz-linear-gradient(top, white 40%, #f0f0f0);
Pierre-Yves Chibon dcf26d
  background-image: -o-linear-gradient(top, white 40%, #f0f0f0);
Pierre-Yves Chibon dcf26d
  background-image: linear-gradient(to bottom, white 40%, #f0f0f0);
Johan Cwiklinski ab027f
  -webkit-transition: left 0.15s ease-out;
Johan Cwiklinski ab027f
  -moz-transition: left 0.15s ease-out;
Johan Cwiklinski ab027f
  -o-transition: left 0.15s ease-out;
Johan Cwiklinski ab027f
  transition: left 0.15s ease-out;
Johan Cwiklinski ab027f
}
Pierre-Yves Chibon dcf26d
Pierre-Yves Chibon dcf26d
.switch-handle:before {
Pierre-Yves Chibon dcf26d
  content: '';
Pierre-Yves Chibon dcf26d
  position: absolute;
Pierre-Yves Chibon dcf26d
  top: 50%;
Pierre-Yves Chibon dcf26d
  left: 50%;
Pierre-Yves Chibon dcf26d
  margin: -6px 0 0 -6px;
Pierre-Yves Chibon dcf26d
  width: 12px;
Pierre-Yves Chibon dcf26d
  height: 12px;
Pierre-Yves Chibon dcf26d
  background: #f9f9f9;
Pierre-Yves Chibon dcf26d
  border-radius: 6px;
Pierre-Yves Chibon dcf26d
  box-shadow: inset 0 1px rgba(0, 0, 0, 0.02);
Pierre-Yves Chibon dcf26d
  background-image: -webkit-linear-gradient(top, #eeeeee, white);
Pierre-Yves Chibon dcf26d
  background-image: -moz-linear-gradient(top, #eeeeee, white);
Pierre-Yves Chibon dcf26d
  background-image: -o-linear-gradient(top, #eeeeee, white);
Pierre-Yves Chibon dcf26d
  background-image: linear-gradient(to bottom, #eeeeee, white);
Pierre-Yves Chibon dcf26d
}
Pierre-Yves Chibon dcf26d
Pierre-Yves Chibon dcf26d
.switch-input:checked ~ .switch-handle {
Pierre-Yves Chibon dcf26d
  left: 59px;
Pierre-Yves Chibon dcf26d
  box-shadow: -1px 1px 5px rgba(0, 0, 0, 0.2);
Pierre-Yves Chibon dcf26d
}
Pierre-Yves Chibon dcf26d
Pierre-Yves Chibon dcf26d
.switch-green > .switch-input:checked ~ .switch-label {
Pierre-Yves Chibon dcf26d
  background: #4fb845;
Johan Cwiklinski ab027f
}