2015-11-18 23:43:36 +03:00
|
|
|
.form-group-toggle-variant(@placeholder-font-size, @line-height){
|
|
|
|
.togglebutton {
|
2015-11-20 19:17:12 +03:00
|
|
|
// Label is set in _inputs.less
|
2015-11-18 23:43:36 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-group {
|
|
|
|
|
2015-11-20 19:17:12 +03:00
|
|
|
//// default label size/location
|
2015-11-21 17:56:29 +03:00
|
|
|
.form-group-toggle-variant(@mdb-input-font-size-base, @mdb-input-line-height-base);
|
2015-11-18 23:43:36 +03:00
|
|
|
|
|
|
|
// sm label size/location
|
|
|
|
&.form-group-sm {
|
2015-11-21 17:56:29 +03:00
|
|
|
.form-group-toggle-variant(@mdb-input-font-size-small, @mdb-input-line-height-small);
|
2015-11-18 23:43:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// lg label size/location
|
|
|
|
&.form-group-lg {
|
2015-11-21 17:56:29 +03:00
|
|
|
.form-group-toggle-variant(@mdb-input-font-size-large, @mdb-input-line-height-large);
|
2015-11-18 23:43:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
.togglebutton {
|
|
|
|
vertical-align: middle;
|
|
|
|
&, label, input, .toggle {
|
|
|
|
user-select: none;
|
2014-12-01 15:29:34 +03:00
|
|
|
}
|
2015-11-18 23:43:36 +03:00
|
|
|
label {
|
|
|
|
cursor: pointer;
|
2015-11-21 17:56:29 +03:00
|
|
|
color: @mdb-toggle-label-color;
|
2015-11-18 23:43:36 +03:00
|
|
|
|
|
|
|
// Hide original checkbox
|
|
|
|
input[type=checkbox] {
|
|
|
|
opacity: 0;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
}
|
|
|
|
// Switch bg off and disabled
|
|
|
|
.toggle,
|
|
|
|
input[type=checkbox][disabled] + .toggle {
|
|
|
|
content: "";
|
|
|
|
display: inline-block;
|
|
|
|
width: 30px;
|
|
|
|
height: 15px;
|
|
|
|
background-color: rgba(80, 80, 80, 0.7);
|
|
|
|
border-radius: 15px;
|
2015-11-20 19:17:12 +03:00
|
|
|
margin-right: 15px;
|
2015-11-18 23:43:36 +03:00
|
|
|
transition: background 0.3s ease;
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
// Handle off
|
|
|
|
.toggle:after {
|
|
|
|
content: "";
|
|
|
|
display: inline-block;
|
|
|
|
width: 20px;
|
|
|
|
height: 20px;
|
|
|
|
background-color: #F1F1F1;
|
|
|
|
border-radius: 20px;
|
|
|
|
position: relative;
|
|
|
|
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4);
|
|
|
|
left: -5px;
|
|
|
|
top: -2px;
|
|
|
|
transition: left 0.3s ease, background 0.3s ease, box-shadow 0.1s ease;
|
|
|
|
}
|
|
|
|
// Handle disabled
|
|
|
|
input[type=checkbox][disabled] + .toggle:after,
|
|
|
|
input[type=checkbox][disabled]:checked + .toggle:after {
|
|
|
|
background-color: #BDBDBD;
|
|
|
|
}
|
|
|
|
// Ripple off and disabled
|
|
|
|
input[type=checkbox] + .toggle:active:after,
|
|
|
|
input[type=checkbox][disabled] + .toggle:active:after {
|
|
|
|
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(0, 0, 0, 0.1);
|
|
|
|
}
|
|
|
|
input[type=checkbox]:checked + .toggle:after {
|
|
|
|
left: 15px;
|
|
|
|
}
|
2014-12-01 15:29:34 +03:00
|
|
|
}
|
2015-03-09 22:56:57 +03:00
|
|
|
|
2015-11-18 23:43:36 +03:00
|
|
|
// Switch bg on
|
|
|
|
// SASS conversion note: please mirror any content change in _mixins-shared.scss bg-color-variations-content
|
2015-11-21 19:37:35 +03:00
|
|
|
.generic-variations(~" label input[type=checkbox]:checked + .toggle", @brand-primary, {
|
2015-11-21 17:56:29 +03:00
|
|
|
background-color: fade(@mdb-color, 50%);
|
2015-11-18 23:53:05 +03:00
|
|
|
});
|
2015-11-18 23:43:36 +03:00
|
|
|
// Handle on
|
|
|
|
// SASS conversion note: please mirror any content change in _mixins-shared.scss variations-content
|
2015-11-21 19:37:35 +03:00
|
|
|
.variations(~" label input[type=checkbox]:checked + .toggle:after", background-color, @brand-primary);
|
2015-11-18 23:43:36 +03:00
|
|
|
// Ripple on
|
2015-11-21 19:37:35 +03:00
|
|
|
.generic-variations(~" label input[type=checkbox]:checked + .toggle:active:after", @brand-primary, {
|
2015-11-21 17:56:29 +03:00
|
|
|
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px fade(@mdb-color, 10%);
|
2015-11-18 23:53:05 +03:00
|
|
|
});
|
2015-11-18 23:43:36 +03:00
|
|
|
}
|
2014-12-01 15:29:34 +03:00
|
|
|
}
|