Sha256: ec8170c183ccf0b81ebc9b50ee3e53e39331eb93b65cfc3d8af2f0b670c4e483

Contents?: true

Size: 1.84 KB

Versions: 39

Compression:

Stored size: 1.84 KB

Contents

/* Switch
   ========================================================================== */

.switch,
.switch * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -khtml-user-select: none;
  -ms-user-select: none;
}

.switch label {
  cursor: pointer;
}

.switch label input[type=checkbox] {
  opacity: 0;
  width: 0;
  height: 0;

  &:checked + .lever {
    background-color: $switch-checked-lever-bg;

    &:after {
      background-color: $switch-bg-color;
      left: 24px;
    }
  }
}

.switch label .lever {
  content: "";
  display: inline-block;
  position: relative;
  width: 40px;
  height: 15px;
  background-color: $switch-unchecked-lever-bg;
  border-radius: $switch-radius;
  margin-right: 10px;
  transition: background 0.3s ease;
  vertical-align: middle;
  margin: 0 16px;

  &:after {
    content: "";
    position: absolute;
    display: inline-block;
    width: 21px;
    height: 21px;
    background-color: $switch-unchecked-bg;
    border-radius: 21px;
    box-shadow: 0 1px 3px 1px rgba(0,0,0,.4);
    left: -5px;
    top: -3px;
    transition: left 0.3s ease, background .3s ease, box-shadow 0.1s ease;
  }
}

// Switch active style
input[type=checkbox]:checked:not(:disabled) ~ .lever:active::after,
input[type=checkbox]:checked:not(:disabled).tabbed:focus ~ .lever::after {
  box-shadow: 0 1px 3px 1px rgba(0,0,0,.4), 0 0 0 15px transparentize($switch-bg-color, .9);
}

input[type=checkbox]:not(:disabled) ~ .lever:active:after,
input[type=checkbox]:not(:disabled).tabbed:focus ~ .lever::after {
  box-shadow: 0 1px 3px 1px rgba(0,0,0,.4), 0 0 0 15px rgba(0, 0, 0, .08);
}

// Disabled Styles
.switch input[type=checkbox][disabled] + .lever {
  cursor: default;
}

.switch label input[type=checkbox][disabled] + .lever:after,
.switch label input[type=checkbox][disabled]:checked + .lever:after {
  background-color: $input-disabled-solid-color;
}

Version data entries

39 entries across 39 versions & 5 rubygems

Version Path
jera_push-2.1.4 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-2.1.3 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-2.1.2 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-2.0.0 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.2.4 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.2.3 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.2.1 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.1.7 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.1.6 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.1.5 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.1.4 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.1.3 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.1.2 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.1.1 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.1.0 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
mtl-1.1.7 vendor/assets/stylesheets/materialize/forms/_switches.scss
mtl-1.1.6 vendor/assets/stylesheets/materialize/forms/_switches.scss
jera_push-1.0.3 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
jera_push-1.0.2 app/assets/styles/jera_push/materialize/components/forms/_switches.scss
materialize-sass-0.98.2 app/assets/stylesheets/materialize/components/forms/_switches.scss