:root {
  /*Background color when it's turned off*/
  --dh-off-color: #d1d3d4;

  /*Background color when it's turned on*/
  --dh-on-color: #38cf5b;
  
  /*Animation speed and type*/
  --dh-animation-speed: 0.15s ease-out;

  /*Font used by the text*/
  --dh-font-family: Arial;

  /*The size used*/
  --dh-font-size: 6pt;

  /*The font weight*/
  --dh-font-weight: 300;
  
  /*Font color when the switch is on*/
  --dh-on-font-color: white;

  /*Font color when the switch is off*/
  --dh-off-font-color: white;

  /*How far the OFF text is from the right side*/
  --dh-label-position-off: 12px;

  /*How far the ON text is from the left side*/
  --dh-label-position-on: 8px;

  /*Small switch width*/
  --dh-width: 50px;

  /*Small switch height*/
  --dh-height: 25px;

  /*Border radius for the handle*/
  --dh-handle-border-radius: 20px;

  /*Border radius for the box*/
  --dh-box-border-radius: 18px;

  /*Shadow for the handle*/
  --dh-handle-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
  
  /*Handle color*/
  --dh-handle-color: white;

  /*Handle width*/
  --dh-handle-width: 15px;

  /*Handle height*/
  --dh-handle-height: 15px;

  /*The handle's width while the toggle is clicked*/
  --dh-onclick-width: 30px;

  /*Handle's distance from the top*/
  --dh-handle-top: 5px;
}

.dh-toggle-container * {
  font-family: var(--dh-font-family);
  -webkit-transition: var(--dh-animation-speed);
  -moz-transition: var(--dh-animation-speed);
  -o-transition: var(--dh-animation-speed);
  transition: var(--dh-animation-speed);
}

.dh-switch {
  width: var(--dh-width);
  height: var(--dh-height);
}

.dh-toggle-container label {
  position: relative;
  display: inline-block;
  vertical-align: top;
  border-radius: var(--dh-box-border-radius);
  cursor: pointer;
}

.dh-switch-input {
  position: absolute;
  transform: translate3d(5px, 5px, 0);
}

.dh-switch-label {
  position: relative;
  display: block;
  height: inherit;
  font-size: var(--dh-font-size);
  font-weight: var(--dh-font-weight);
  background: var(--dh-off-color);
  border-radius: inherit;
}

.dh-switch-label:before,
.dh-switch-label:after {
  position: absolute;
  top: 50%;
  margin-top: -0.5em;
  line-height: 1.1;
}

.dh-switch-label:before {
  content: attr(data-off);
  color: var(--dh-on-font-color);
}

.dh-switch-label:after {
  content: attr(data-on);
  color: var(--dh-off-font-color);
  opacity: 0;
}

.dh-switch-label:before {
  right: var(--dh-label-position-off);;
}

.dh-switch-label:after {
  left: var(--dh-label-position-on);;
}

.dh-switch-input:checked ~ .dh-switch-label {
  background: var(--dh-on-color);
}

.dh-switch-input:checked ~ .dh-switch-label:before {
  opacity: 0;
}

.dh-switch-input:checked ~ .dh-switch-label:after {
  opacity: 1;
}

.dh-handle {
  position: absolute !important;
  top: var(--dh-handle-top);
  left: 5px;
  background: var(--dh-handle-color);
  border-radius: var(--dh-handle-border-radius);
  box-shadow: var(--dh-handle-shadow);
}

.dh-handle {
  width: var(--dh-handle-width);
  height: var(--dh-handle-height);
}

.dh-handle:before {
  content: "";
  top: 50%;
  left: 50%;
  position: absolute !important;
  margin: -6px 0 0 -6px;
  width: 12px;
  height: 12px;
  border-radius: 6px;
}

.dh-switch-label:active ~ .dh-handle, .dh-handle:active {
  width: var(--dh-onclick-width);
}

.dh-switch-input:checked ~ .dh-handle {
  left: unset;
  right: 5px;
}
