3 $toggle-width: em(40) !default;
4 $toggle-width-button: em(24) !default;
7 max-block-size: $toggle-width-button;
12 // specificity issue with flex helpers
14 z-index: 0; // Create stacking context
16 inline-size: $toggle-width;
17 min-block-size: $toggle-width-button;
18 max-block-size: $toggle-width-button;
19 border-radius: #{math.div($toggle-width, 2)};
20 background-color: var(--background-norm);
28 inset-inline-start: 0;
30 inline-size: #{$toggle-width-button};
31 transform: translateX(0);
32 border-radius: $toggle-width-button;
33 background-color: var(--field-norm);
35 transform 0.25s easing(ease-out-back),
36 background-color 0.25s easing(ease-out-cubic);
43 inset-inline-start: 0;
44 inline-size: $toggle-width;
46 border-radius: #{math.div($toggle-width, 2)};
47 border: 1px solid var(--field-norm);
48 transition: 0.15s easing(ease-out-cubic);
51 & > .toggle-container-text {
56 border-radius: $toggle-width-button;
57 inline-size: $toggle-width-button;
61 inset-inline-start: 0;
62 color: var(--text-norm);
68 color: var(--interaction-norm-contrast);
71 .toggle-container-img {
74 transition: opacity 0.15s easing(ease-out-cubic);
77 .toggle-container-loader {
82 color: var(--interaction-norm-contrast);
83 animation: 0.25s easing(ease-out-cubic) forwards anime-toggle-container-loader-fade-in;
85 @keyframes anime-toggle-container-loader-fade-in {
102 // will be done later
112 .toggle-container-text {
120 .toggle-container-img {
127 transform: translateX(#{$toggle-width - $toggle-width-button});
128 background-color: var(--interaction-norm);
131 transform: translateX(-#{$toggle-width - $toggle-width-button});
142 // disabled but not loading
143 &:not(.toggle-container--loading) {
145 background-color: var(--background-strong);
148 background-color: var(--field-norm);
151 &.toggle-container--checked {
153 background-color: var(--interaction-norm);
159 &.toggle-container--loading {
160 .toggle-container-text .toggle-container-img {
164 &:not(.toggle-container--checked) {
166 background-color: var(--field-hover);
170 &.toggle-container--checked {
172 background-color: var(--interaction-norm-hover);
178 &:not(.toggle-container--disabled) {
181 background-color: var(--field-hover);
186 .toggle-container:has(:hover) & {
188 background-color: var(--field-hover);
193 @supports not selector(:focus-visible:has(a, b)) {
196 border-color: var(--focus-outline);
197 box-shadow: 0 0 0 #{$focus-ring-size} var(--focus-ring);
202 @supports selector(:focus-visible:has(a, b)) {
203 &:has(*:focus-visible) {
205 border-color: var(--focus-outline);
206 box-shadow: 0 0 0 #{$focus-ring-size} var(--focus-ring);
211 &.toggle-container--checked:hover {
213 background-color: var(--interaction-norm-hover);
218 .toggle-container:has(:hover) .toggle-container--checked.toggle-container--checked {
220 background-color: var(--interaction-norm-hover);
225 &.toggle-container--loading {
226 .toggle-container-text .toggle-container-img {
230 &:not(.toggle-container--checked) {
232 background-color: var(--field-hover);
236 &.toggle-container--checked {
238 background-color: var(--interaction-norm-hover);
248 margin-block-start: 0.25em;
251 .toggle-container-img {
252 inline-size: rem(13);