2015-07-17 14:47:49 +09:30
|
|
|
.Checkbox {
|
|
|
|
display: block;
|
|
|
|
cursor: pointer;
|
|
|
|
margin: 0;
|
2021-08-16 11:56:10 +02:00
|
|
|
position: relative;
|
|
|
|
|
|
|
|
input[type="checkbox"] {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 1;
|
|
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2015-07-17 14:47:49 +09:30
|
|
|
|
2021-08-16 11:56:10 +02:00
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
.add-keyboard-focus-ring-nearby("+ .Checkbox-display");
|
2015-07-17 14:47:49 +09:30
|
|
|
}
|
|
|
|
}
|
|
|
|
.Checkbox--switch {
|
2021-08-16 11:56:10 +02:00
|
|
|
@left-pad: 65px;
|
|
|
|
|
|
|
|
padding-left: @left-pad;
|
2015-07-17 14:47:49 +09:30
|
|
|
margin: 5px 0;
|
|
|
|
|
2021-08-16 11:56:10 +02:00
|
|
|
input[type="checkbox"] {
|
|
|
|
top: -4px;
|
|
|
|
width: 50px;
|
|
|
|
height: 28px;
|
|
|
|
}
|
|
|
|
|
2015-07-17 14:47:49 +09:30
|
|
|
.Checkbox-display {
|
|
|
|
float: left;
|
2021-08-16 11:56:10 +02:00
|
|
|
margin-left: -@left-pad;
|
2015-07-17 14:47:49 +09:30
|
|
|
margin-top: -4px;
|
|
|
|
}
|
|
|
|
}
|
2021-04-09 00:42:32 +01:00
|
|
|
|
2015-07-17 14:47:49 +09:30
|
|
|
.Checkbox--switch .Checkbox-display {
|
|
|
|
width: 50px;
|
|
|
|
height: 28px;
|
|
|
|
padding: 3px;
|
|
|
|
position: relative;
|
|
|
|
border-radius: 14px;
|
|
|
|
background: @control-bg;
|
2021-08-21 19:34:07 +01:00
|
|
|
transition: background-color 0.2s;
|
2015-07-17 14:47:49 +09:30
|
|
|
|
2021-04-09 00:42:32 +01:00
|
|
|
.LoadingIndicator {
|
|
|
|
--size: 22px !important;
|
|
|
|
|
|
|
|
&-container {
|
|
|
|
height: 22px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-17 14:47:49 +09:30
|
|
|
.on& {
|
2020-04-10 16:51:58 -04:00
|
|
|
background: #58a400;
|
2021-04-09 00:42:32 +01:00
|
|
|
|
|
|
|
.LoadingIndicator-container {
|
|
|
|
// Show loading indicator over the switch button
|
|
|
|
justify-content: flex-end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.off& {
|
|
|
|
.LoadingIndicator-container {
|
|
|
|
// Show loading indicator over the switch button
|
|
|
|
justify-content: flex-start;
|
|
|
|
}
|
2015-07-17 14:47:49 +09:30
|
|
|
}
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
position: absolute;
|
|
|
|
width: 22px;
|
|
|
|
height: 22px;
|
|
|
|
padding: 0;
|
|
|
|
left: 3px;
|
2021-08-21 19:34:07 +01:00
|
|
|
transition: opacity 0.2s, left 0.2s;
|
2015-07-17 14:47:49 +09:30
|
|
|
|
|
|
|
.on& {
|
|
|
|
left: 25px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&:before {
|
2020-04-10 16:51:58 -04:00
|
|
|
content: " ";
|
2015-07-17 14:47:49 +09:30
|
|
|
background: @body-bg;
|
|
|
|
border-radius: 11px;
|
|
|
|
box-shadow: 0 2px 4px @shadow-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.Checkbox-display {
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
.on & {
|
2020-04-10 16:51:58 -04:00
|
|
|
color: #58a400;
|
2015-07-17 14:47:49 +09:30
|
|
|
}
|
|
|
|
.off & {
|
2020-04-10 16:51:58 -04:00
|
|
|
color: #d0021b;
|
2015-07-17 14:47:49 +09:30
|
|
|
}
|
|
|
|
.disabled & {
|
|
|
|
color: @muted-more-color !important;
|
|
|
|
}
|
|
|
|
}
|
2020-04-10 16:51:58 -04:00
|
|
|
.Checkbox--switch.loading {
|
|
|
|
color: @muted-more-color !important;
|
|
|
|
|
|
|
|
&.on .Checkbox-display {
|
|
|
|
background: fade(#58a400, 0.5);
|
|
|
|
}
|
|
|
|
&.off .Checkbox-display {
|
|
|
|
background: fade(@control-bg, 0.5);
|
|
|
|
}
|
|
|
|
.LoadingIndicator {
|
|
|
|
color: darken(@muted-color, 50%);
|
|
|
|
}
|
|
|
|
}
|