123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- @bootstrap-switch-base: bootstrap-switch;
- .@{bootstrap-switch-base} {
- display: inline-block;
- direction: ltr;
- cursor: pointer;
- border-radius: @border-radius-base;
- border: 1px solid;
- border-color: @btn-default-border;
- position: relative;
- text-align: left;
- overflow: hidden;
- line-height: 8px;
- z-index: 0;
- .user-select(none);
- vertical-align: middle;
- .transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
- .@{bootstrap-switch-base}-container {
- display: inline-block;
- top: 0;
- border-radius: @border-radius-base;
- .translate3d(0, 0, 0);
- }
- .@{bootstrap-switch-base}-handle-on,
- .@{bootstrap-switch-base}-handle-off,
- .@{bootstrap-switch-base}-label {
- .box-sizing(border-box);
- cursor: pointer;
- display: inline-block !important;
- height: 100%;
- padding: @padding-base-vertical @padding-base-horizontal;
- font-size: @font-size-base;
- line-height: @line-height-computed;
- }
- .@{bootstrap-switch-base}-handle-on,
- .@{bootstrap-switch-base}-handle-off {
- text-align: center;
- z-index: 1;
- &.@{bootstrap-switch-base}-primary {
- color: #fff;
- background: @btn-primary-bg;
- }
- &.@{bootstrap-switch-base}-info {
- color: #fff;
- background: @btn-info-bg;
- }
- &.@{bootstrap-switch-base}-success {
- color: #fff;
- background: @btn-success-bg;
- }
- &.@{bootstrap-switch-base}-warning {
- background: @btn-warning-bg;
- color: #fff;
- }
- &.@{bootstrap-switch-base}-danger {
- color: #fff;
- background: @btn-danger-bg;
- }
- &.@{bootstrap-switch-base}-default {
- color: #000;
- background: @gray-lighter;
- }
- }
- .@{bootstrap-switch-base}-label {
- text-align: center;
- margin-top: -1px;
- margin-bottom: -1px;
- z-index: 100;
- color: @btn-default-color;
- background: @btn-default-bg;
- }
- .@{bootstrap-switch-base}-handle-on {
- .border-left-radius(@border-radius-base - 1);
- }
- .@{bootstrap-switch-base}-handle-off {
- .border-right-radius(@border-radius-base - 1);
- }
- input[type='radio'],
- input[type='checkbox'] {
- position: absolute !important;
- top: 0;
- left: 0;
- .opacity(0);
- z-index: -1;
- &.form-control {
- height: auto;
- }
- }
- &.@{bootstrap-switch-base}-mini {
- .@{bootstrap-switch-base}-handle-on,
- .@{bootstrap-switch-base}-handle-off,
- .@{bootstrap-switch-base}-label {
- padding: @padding-xs-vertical @padding-xs-horizontal;
- font-size: @font-size-small;
- line-height: @line-height-small;
- }
- }
- &.@{bootstrap-switch-base}-small {
- .@{bootstrap-switch-base}-handle-on,
- .@{bootstrap-switch-base}-handle-off,
- .@{bootstrap-switch-base}-label {
- padding: @padding-small-vertical @padding-small-horizontal;
- font-size: @font-size-small;
- line-height: @line-height-small;
- }
- }
- &.@{bootstrap-switch-base}-large {
- .@{bootstrap-switch-base}-handle-on,
- .@{bootstrap-switch-base}-handle-off,
- .@{bootstrap-switch-base}-label {
- padding: @padding-base-vertical @padding-large-horizontal;
- font-size: @font-size-large;
- line-height: @line-height-large;
- }
- }
- &.@{bootstrap-switch-base}-disabled,
- &.@{bootstrap-switch-base}-readonly,
- &.@{bootstrap-switch-base}-indeterminate {
- cursor: default !important;
- .@{bootstrap-switch-base}-handle-on,
- .@{bootstrap-switch-base}-handle-off,
- .@{bootstrap-switch-base}-label {
- .opacity(.5);
- cursor: default !important;
- }
- }
- &.@{bootstrap-switch-base}-animate {
- .@{bootstrap-switch-base}-container {
- .transition(margin-left .5s);
- }
- }
- &.@{bootstrap-switch-base}-inverse {
- .@{bootstrap-switch-base}-handle-on {
- .border-left-radius(0);
- .border-right-radius(@border-radius-base - 1);
- }
- .@{bootstrap-switch-base}-handle-off {
- .border-right-radius(0);
- .border-left-radius(@border-radius-base - 1);
- }
- }
- &.@{bootstrap-switch-base}-focused {
- @color-rgba: rgba(red(@input-border-focus), green(@input-border-focus), blue(@input-border-focus), .6);
- border-color: @input-border-focus;
- outline: 0;
- .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
- }
- &.@{bootstrap-switch-base}-on,
- &.@{bootstrap-switch-base}-inverse.@{bootstrap-switch-base}-off {
- .@{bootstrap-switch-base}-label {
- .border-right-radius(@border-radius-base - 1);
- }
- }
- &.@{bootstrap-switch-base}-off,
- &.@{bootstrap-switch-base}-inverse.@{bootstrap-switch-base}-on {
- .@{bootstrap-switch-base}-label {
- .border-left-radius(@border-radius-base - 1);
- }
- }
- }
|