2015-11-21 21:15:29 +03:00
|
|
|
.togglebutton {
|
|
|
|
vertical-align: middle;
|
|
|
|
&, label, input, .toggle {
|
|
|
|
user-select: none;
|
2015-11-18 23:43:36 +03:00
|
|
|
}
|
2015-11-21 21:15:29 +03:00
|
|
|
label {
|
|
|
|
cursor: pointer;
|
|
|
|
color: @mdb-toggle-label-color;
|
2015-12-09 20:24:09 +03:00
|
|
|
.mdb-label-color-toggle-focus();
|
2015-11-18 23:43:36 +03:00
|
|
|
|
2015-11-21 21:15:29 +03:00
|
|
|
// Hide original checkbox
|
|
|
|
input[type=checkbox] {
|
|
|
|
opacity: 0;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
2014-12-01 15:29:34 +03:00
|
|
|
}
|
2015-12-08 19:52:29 +03:00
|
|
|
|
|
|
|
.toggle {
|
|
|
|
text-align: left; // Issue #737 horizontal form
|
|
|
|
}
|
2015-11-21 21:15:29 +03:00
|
|
|
// 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;
|
|
|
|
margin-right: 15px;
|
|
|
|
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;
|
|
|
|
}
|
2015-11-24 02:43:41 +03:00
|
|
|
input[type=checkbox] {
|
|
|
|
// Handle disabled
|
|
|
|
&[disabled] {
|
|
|
|
& + .toggle:after,
|
|
|
|
&:checked + .toggle:after {
|
|
|
|
background-color: #BDBDBD;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
& + .toggle:active:after,
|
|
|
|
&[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);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ripple off and disabled
|
|
|
|
&:checked + .toggle:after {
|
|
|
|
left: 15px;
|
|
|
|
}
|
2015-11-21 21:15:29 +03:00
|
|
|
}
|
2015-11-24 02:43:41 +03:00
|
|
|
|
2015-12-08 19:59:21 +03:00
|
|
|
// set bg when checked
|
|
|
|
input[type=checkbox]:checked {
|
|
|
|
+ .toggle {
|
2015-11-24 02:43:41 +03:00
|
|
|
background-color: fade(@brand-primary, 50%); // Switch bg on
|
|
|
|
}
|
|
|
|
|
2015-12-08 19:59:21 +03:00
|
|
|
+ .toggle:after {
|
2015-11-24 02:43:41 +03:00
|
|
|
background-color: @brand-primary; // Handle on
|
|
|
|
}
|
|
|
|
|
2015-12-08 19:59:21 +03:00
|
|
|
+ .toggle:active:after {
|
2015-11-24 02:43:41 +03:00
|
|
|
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px fade(@brand-primary, 10%); // Ripple on
|
|
|
|
}
|
2014-12-01 15:29:34 +03:00
|
|
|
}
|
2015-11-18 23:43:36 +03:00
|
|
|
}
|
2014-12-01 15:29:34 +03:00
|
|
|
}
|