2024-02-24 19:51:58 +01:00
|
|
|
@use "sass:math";
|
|
|
|
|
|
|
|
$toggle-width: 162;
|
|
|
|
$toggle-height: 72;
|
|
|
|
|
|
|
|
$toggle-floater-width: 80;
|
|
|
|
$toggle-floater-height: 64;
|
|
|
|
$toggle-floater-margin: 4;
|
|
|
|
$toggle-checked-left-offset: $toggle-width - $toggle-floater-margin - $toggle-floater-width;
|
|
|
|
|
|
|
|
.toggle {
|
|
|
|
@extend %nav-all;
|
|
|
|
@include trans-colors-opa;
|
|
|
|
display: flex;
|
2024-04-21 17:54:48 +02:00
|
|
|
position: relative;
|
2024-02-24 19:51:58 +01:00
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
width: space($toggle-width);
|
|
|
|
height: space($toggle-height);
|
|
|
|
border-radius: space(math.div($toggle-height, 2));
|
|
|
|
opacity: 0.9;
|
2024-04-21 17:54:48 +02:00
|
|
|
background: $color-transparent;
|
|
|
|
cursor: pointer;
|
2024-02-24 19:51:58 +01:00
|
|
|
|
|
|
|
&:hover, &:focus-visible, &:focus {
|
|
|
|
opacity: 1;
|
2024-04-21 17:54:48 +02:00
|
|
|
background-color: $color-secondary-a30;
|
2024-02-24 19:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
opacity: 1;
|
2024-04-21 17:54:48 +02:00
|
|
|
background-color: $color-secondary-a5;
|
2024-02-24 19:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.toggle__border {
|
|
|
|
@include inner-border-block($color-secondary-l);
|
|
|
|
border-radius: space(math.div($toggle-height, 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
.toggle__floater {
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
left: space($toggle-floater-margin);
|
2024-04-21 17:54:48 +02:00
|
|
|
width: space($toggle-floater-width);
|
|
|
|
height: space($toggle-floater-height);
|
2024-02-24 19:51:58 +01:00
|
|
|
transform: translateY(-50%);
|
|
|
|
border-radius: space(math.div($toggle-floater-height, 2));
|
|
|
|
background: $color-secondary-d;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--checked {
|
|
|
|
.toggle__floater {
|
|
|
|
left: space($toggle-checked-left-offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
.toggle__icon {
|
|
|
|
&.toggle__icon--left {
|
|
|
|
opacity: 0.9;
|
2024-04-21 17:54:48 +02:00
|
|
|
color: $color-secondary-l;
|
2024-02-24 19:51:58 +01:00
|
|
|
}
|
2024-04-21 17:54:48 +02:00
|
|
|
|
2024-02-24 19:51:58 +01:00
|
|
|
&.toggle__icon--right {
|
|
|
|
opacity: 1.0;
|
2024-04-21 17:54:48 +02:00
|
|
|
color: $color-text;
|
2024-02-24 19:51:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.toggle__icons {
|
|
|
|
display: flex;
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
right: space(16);
|
|
|
|
left: space(16);
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
2024-04-21 17:54:48 +02:00
|
|
|
height: space(56);
|
|
|
|
transform: translateY(-50%);
|
2024-02-24 19:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.toggle__icon {
|
|
|
|
@extend %prompt-font-lg;
|
|
|
|
@include trans-colors;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
width: space(56);
|
|
|
|
height: space(56);
|
|
|
|
color: $color-text;
|
|
|
|
|
|
|
|
&--right {
|
|
|
|
opacity: 1;
|
|
|
|
color: $color-secondary-l;
|
|
|
|
}
|
|
|
|
}
|