Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

59 lines
1.5 KiB

@import '_mixins';
@import '_vars';
$toggle-width: 2.2rem;
$toggle-height: 1.25rem;
$toggle-button-size: $toggle-height - .25rem;
.toggle {
&-button {
@include circle($toggle-button-size);
@include box-shadow(0, 2px, 2px, .2);
@include absolute($toggle-height * .5, auto, auto, $toggle-width * .5);
background: $color-dark-foreground;
border: 0;
margin-left: -$toggle-button-size * .5;
margin-top: -$toggle-button-size * .5;
transition: left .3s ease;
}
&-container {
& {
@include border-radius($toggle-height * .5);
@include box-shadow-inner;
background: lighten($color-border, 6%);
border: 0;
display: inline-block;
height: $toggle-height;
position: relative;
transition: background-color .3s ease;
width: $toggle-width;
}
&.checked {
& {
background: $color-theme-green-dark;
}
.toggle-button {
left: $toggle-height * .5;
}
}
&.unchecked {
& {
background: $color-theme-error;
}
.toggle-button {
left: $toggle-width - $toggle-height * .5;
}
}
&.disabled {
background: $color-input-disabled;
border: 0;
cursor: not-allowed;
}
}
}