open-vault/ui/app/styles/core/switch.scss

36 lines
798 B
SCSS
Raw Normal View History

.switch[type='checkbox'] {
2018-04-03 14:16:57 +00:00
&.is-small {
+ label {
2018-10-09 04:19:58 +00:00
font-size: $size-8;
2018-04-03 14:16:57 +00:00
font-weight: bold;
2018-10-09 04:19:58 +00:00
padding-left: $size-8 * 2.5;
2018-04-03 14:16:57 +00:00
margin: 0 0.25rem;
&::before {
2018-10-09 04:19:58 +00:00
top: $size-8 / 5;
height: $size-8;
width: $size-8 * 2;
2018-04-03 14:16:57 +00:00
}
&::after {
2018-10-09 04:19:58 +00:00
width: $size-8 * 0.8;
height: $size-8 * 0.8;
transform: translateX(0.15rem);
left: 0;
2018-10-09 04:19:58 +00:00
top: $size-8/ 4;
2018-04-03 14:16:57 +00:00
}
}
&:checked + label::after {
2018-10-09 04:19:58 +00:00
left: 0;
transform: translateX(($size-8 * 2) - ($size-8 * 0.94));
2018-04-03 14:16:57 +00:00
}
}
}
.switch[type='checkbox'].is-small + label::after {
will-change: left;
2018-10-09 04:19:58 +00:00
}
.switch[type='checkbox']:focus + label {
2018-04-03 14:16:57 +00:00
box-shadow: 0 0 1px $blue;
}
.switch[type='checkbox'].is-success:checked + label::before {
2018-10-09 04:19:58 +00:00
background: $blue;
}