opui-css 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4105 @@
1
+ @layer openprops, normalize, theme, components.root, components.extended, utils;
2
+
3
+ /* Open Props */
4
+
5
+ /*
6
+ * Open Props
7
+ * Import as many props as you need here.
8
+ * https://unpkg.com/browse/open-props@2.0.0-beta.5/css
9
+ */
10
+
11
+ @custom-media --motionOK (prefers-reduced-motion: no-preference);
12
+
13
+ @custom-media --motionNotOK (prefers-reduced-motion: reduce);
14
+
15
+ @custom-media --opacityOK (prefers-reduced-transparency: no-preference);
16
+
17
+ @custom-media --opacityNotOK (prefers-reduced-transparency: reduce);
18
+
19
+ @custom-media --useDataOK (prefers-reduced-data: no-preference);
20
+
21
+ @custom-media --useDataNotOK (prefers-reduced-data: reduce);
22
+
23
+ @custom-media --OSdark (prefers-color-scheme: dark);
24
+
25
+ @custom-media --OSlight (prefers-color-scheme: light);
26
+
27
+ @custom-media --highContrast (prefers-contrast: more);
28
+
29
+ @custom-media --lowContrast (prefers-contrast: less);
30
+
31
+ @custom-media --portrait (orientation: portrait);
32
+
33
+ @custom-media --landscape (orientation: landscape);
34
+
35
+ @custom-media --HDcolor (dynamic-range: high);
36
+
37
+ @custom-media --touch (hover: none) and (pointer: coarse);
38
+
39
+ @custom-media --stylus (hover: none) and (pointer: fine);
40
+
41
+ @custom-media --pointer (hover) and (pointer: coarse);
42
+
43
+ @custom-media --mouse (hover) and (pointer: fine);
44
+
45
+ @custom-media --xxs-only (0px <= width <= 240px);
46
+
47
+ @custom-media --xxs-n-above (width >= 240px);
48
+
49
+ @custom-media --xxs-n-below (width < 240px);
50
+
51
+ @custom-media --xxs-phone (--xxs-only) and (--portrait);
52
+
53
+ @custom-media --xs-only (240px <= width <= 360px);
54
+
55
+ @custom-media --xs-n-above (width >= 360px);
56
+
57
+ @custom-media --xs-n-below (width < 360px);
58
+
59
+ @custom-media --xs-phone (--xs-only) and (--portrait);
60
+
61
+ @custom-media --sm-only (360px <= width <= 480px);
62
+
63
+ @custom-media --sm-n-above (width >= 480px);
64
+
65
+ @custom-media --sm-n-below (width < 480px);
66
+
67
+ @custom-media --sm-phone (--sm-only) and (--portrait);
68
+
69
+ @custom-media --md-only (480px <= width <= 768px);
70
+
71
+ @custom-media --md-n-above (width >= 768px);
72
+
73
+ @custom-media --md-n-below (width < 768px);
74
+
75
+ @custom-media --md-phone (--md-only) and (--portrait);
76
+
77
+ @custom-media --lg-only (768px <= width <= 1024px);
78
+
79
+ @custom-media --lg-n-above (width >= 1024px);
80
+
81
+ @custom-media --lg-n-below (width < 1024px);
82
+
83
+ @custom-media --lg-phone (--lg-only) and (--portrait);
84
+
85
+ @custom-media --xl-only (1024px <= width <= 1440px);
86
+
87
+ @custom-media --xl-n-above (width >= 1440px);
88
+
89
+ @custom-media --xl-n-below (width < 1440px);
90
+
91
+ @custom-media --xxl-only (1440px <= width <= 1920px);
92
+
93
+ @custom-media --xxl-n-above (width >= 1920px);
94
+
95
+ @custom-media --xxl-n-below (width < 1920px);
96
+
97
+ @layer openprops{
98
+ :where(:root){--font-sans:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;--font-serif:ui-serif,serif;--font-mono:Dank Mono,Operator Mono,Inconsolata,Fira Mono,ui-monospace,SF Mono,Monaco,Droid Sans Mono,Source Code Pro,monospace;--font-weight-1:100;--font-weight-2:200;--font-weight-3:300;--font-weight-4:400;--font-weight-5:500;--font-weight-6:600;--font-weight-7:700;--font-weight-8:800;--font-weight-9:900;--font-size-00:.5rem;--font-size-0:.75rem;--font-size-1:1rem;--font-size-2:1.1rem;--font-size-3:1.25rem;--font-size-4:1.5rem;--font-size-5:2rem;--font-size-6:2.5rem;--font-size-7:3rem;--font-size-8:3.5rem;--font-size-fluid-0:clamp(.75rem,2vw,1rem);--font-size-fluid-1:clamp(1rem,4vw,1.5rem);--font-size-fluid-2:clamp(1.5rem,6vw,2.5rem);--font-size-fluid-3:clamp(2rem,9vw,3.5rem);--size-000:-.5rem;--size-00:-.25rem;--size-1:.25rem;--size-2:.5rem;--size-3:1rem;--size-4:1.25rem;--size-5:1.5rem;--size-6:1.75rem;--size-7:2rem;--size-8:3rem;--size-9:4rem;--size-10:5rem;--size-11:7.5rem;--size-12:10rem;--size-13:15rem;--size-14:20rem;--size-15:30rem;--size-fluid-1:clamp(.5rem,1vw,1rem);--size-fluid-2:clamp(1rem,2vw,1.5rem);--size-fluid-3:clamp(1.5rem,3vw,2rem);--size-fluid-4:clamp(2rem,4vw,3rem);--size-fluid-5:clamp(4rem,5vw,5rem);--size-fluid-6:clamp(5rem,7vw,7.5rem);--size-fluid-7:clamp(7.5rem,10vw,10rem);--size-fluid-8:clamp(10rem,20vw,15rem);--size-fluid-9:clamp(15rem,30vw,20rem);--size-fluid-10:clamp(20rem,40vw,30rem);--size-header-1:20ch;--size-header-2:25ch;--size-header-3:35ch;--size-content-1:20ch;--size-content-2:45ch;--size-content-3:60ch;--ratio-square:1;--ratio-landscape:4/3;--ratio-portrait:3/4;--ratio-widescreen:16/9;--ratio-ultrawide:18/5;--ratio-golden:1.618/1;--layer-1:1;--layer-2:2;--layer-3:3;--layer-4:4;--layer-5:5;--layer-bottom:var(--layer-1);--layer-top:var(--layer-5);--layer-important:2147480000;--border-size-1:1px;--border-size-2:2px;--border-size-3:5px;--border-size-4:10px;--border-size-5:25px;--radius-1:2px;--radius-2:5px;--radius-3:1rem;--radius-4:2rem;--radius-5:4rem;--radius-6:8rem;--radius-round:100000px;--radius-blob-1:30% 70% 70% 30%/53% 30% 70% 47%;--radius-blob-2:53% 47% 34% 66%/63% 46% 54% 37%;--radius-blob-3:37% 63% 56% 44%/49% 56% 44% 51%;--radius-blob-4:63% 37% 37% 63%/43% 37% 63% 57%;--radius-blob-5:49% 51% 48% 52%/57% 44% 56% 43%;--radius-conditional-1:clamp(0px,calc(100vw - 100%)*100000,var(--radius-1));--radius-conditional-2:clamp(0px,calc(100vw - 100%)*100000,var(--radius-2));--radius-conditional-3:clamp(0px,calc(100vw - 100%)*100000,var(--radius-3));--radius-conditional-4:clamp(0px,calc(100vw - 100%)*100000,var(--radius-4));--radius-conditional-5:clamp(0px,calc(100vw - 100%)*100000,var(--radius-5));--radius-conditional-6:clamp(0px,calc(100vw - 100%)*100000,var(--radius-6))}*{--shadow-strength:1%;--shadow-chroma:3%;--shadow-hue:var(--shadow-tint,var(--palette-hue));--shadow-color:15% var(--shadow-chroma)var(--shadow-hue);--inner-shadow-highlight:inset 0 -.5px 0 0 #fff,inset 0 .5px 0 0 #0001;--shadow-1:0 1px 2px -1px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 9%));--shadow-2:0 3px 5px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 3%)),0 7px 14px -5px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 5%));--shadow-3:0 -1px 3px 0 oklch(var(--shadow-color)/calc(var(--shadow-strength) + 2%)),0 1px 2px -5px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 2%)),0 2px 5px -5px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 4%)),0 4px 12px -5px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 5%)),0 12px 15px -5px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 7%));--shadow-4:0 -2px 5px 0 oklch(var(--shadow-color)/calc(var(--shadow-strength) + 2%)),0 1px 1px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 3%)),0 2px 2px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 3%)),0 5px 5px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 4%)),0 9px 9px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 5%)),0 16px 16px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 6%));--shadow-5:0 -1px 2px 0 oklch(var(--shadow-color)/calc(var(--shadow-strength) + 2%)),0 2px 1px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 3%)),0 5px 5px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 3%)),0 10px 10px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 4%)),0 20px 20px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 5%)),0 40px 40px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 7%));--shadow-6:0 -1px 2px 0 oklch(var(--shadow-color)/calc(var(--shadow-strength) + 2%)),0 3px 2px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 3%)),0 7px 5px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 3%)),0 12px 10px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 4%)),0 22px 18px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 5%)),0 41px 33px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 6%)),0 100px 80px -2px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 7%));--inner-shadow-0:inset 0 0 0 1px oklch(var(--shadow-color)/calc(var(--shadow-strength) + 9%));--inner-shadow-1:inset 0 1px 2px 0 oklch(var(--shadow-color)/calc(var(--shadow-strength) + 9%)),var(--inner-shadow-highlight);--inner-shadow-2:inset 0 1px 4px 0 oklch(var(--shadow-color)/calc(var(--shadow-strength) + 9%)),var(--inner-shadow-highlight);--inner-shadow-3:inset 0 2px 8px 0 oklch(var(--shadow-color)/calc(var(--shadow-strength) + 9%)),var(--inner-shadow-highlight);--inner-shadow-4:inset 0 2px 14px 0 oklch(var(--shadow-color)/calc(var(--shadow-strength) + 9%)),var(--inner-shadow-highlight)}@media (prefers-color-scheme:dark){*{--shadow-strength:25%;--shadow-chroma:10%;--shadow-hue:var(--shadow-tint,var(--palette-hue));--shadow-color:15% var(--shadow-chroma)var(--shadow-hue);--inner-shadow-highlight:inset 0 -.5px 0 0 #fff1,inset 0 .5px 0 0 #0007}}:where(:root){--ease-1:cubic-bezier(.25,0,.5,1);--ease-2:cubic-bezier(.25,0,.4,1);--ease-3:cubic-bezier(.25,0,.3,1);--ease-4:cubic-bezier(.25,0,.2,1);--ease-5:cubic-bezier(.25,0,.1,1);--ease-in-1:cubic-bezier(.25,0,1,1);--ease-in-2:cubic-bezier(.5,0,1,1);--ease-in-3:cubic-bezier(.7,0,1,1);--ease-in-4:cubic-bezier(.9,0,1,1);--ease-in-5:cubic-bezier(1,0,1,1);--ease-out-1:cubic-bezier(0,0,.75,1);--ease-out-2:cubic-bezier(0,0,.5,1);--ease-out-3:cubic-bezier(0,0,.3,1);--ease-out-4:cubic-bezier(0,0,.1,1);--ease-out-5:cubic-bezier(0,0,0,1);--ease-in-out-1:cubic-bezier(.1,0,.9,1);--ease-in-out-2:cubic-bezier(.3,0,.7,1);--ease-in-out-3:cubic-bezier(.5,0,.5,1);--ease-in-out-4:cubic-bezier(.7,0,.3,1);--ease-in-out-5:cubic-bezier(.9,0,.1,1);--ease-elastic-out-1:cubic-bezier(.5,.75,.75,1.25);--ease-elastic-out-2:cubic-bezier(.5,1,.75,1.25);--ease-elastic-out-3:cubic-bezier(.5,1.25,.75,1.25);--ease-elastic-out-4:cubic-bezier(.5,1.5,.75,1.25);--ease-elastic-out-5:cubic-bezier(.5,1.75,.75,1.25);--ease-elastic-in-1:cubic-bezier(.5,-.25,.75,1);--ease-elastic-in-2:cubic-bezier(.5,-.5,.75,1);--ease-elastic-in-3:cubic-bezier(.5,-.75,.75,1);--ease-elastic-in-4:cubic-bezier(.5,-1,.75,1);--ease-elastic-in-5:cubic-bezier(.5,-1.25,.75,1);--ease-elastic-in-out-1:cubic-bezier(.5,-.1,.1,1.5);--ease-elastic-in-out-2:cubic-bezier(.5,-.3,.1,1.5);--ease-elastic-in-out-3:cubic-bezier(.5,-.5,.1,1.5);--ease-elastic-in-out-4:cubic-bezier(.5,-.7,.1,1.5);--ease-elastic-in-out-5:cubic-bezier(.5,-.9,.1,1.5);--ease-step-1:steps(2);--ease-step-2:steps(3);--ease-step-3:steps(4);--ease-step-4:steps(7);--ease-step-5:steps(10);--ease-spring-1:linear(0,.006,.025 2.8%,.101 6.1%,.539 18.9%,.721 25.3%,.849 31.5%,.937 38.1%,.968 41.8%,.991 45.7%,1.006 50.1%,1.015 55%,1.017 63.9%,1.001);--ease-spring-2:linear(0,.007,.029 2.2%,.118 4.7%,.625 14.4%,.826 19%,.902,.962,1.008 26.1%,1.041 28.7%,1.064 32.1%,1.07 36%,1.061 40.5%,1.015 53.4%,.999 61.6%,.995 71.2%,1);--ease-spring-3:linear(0,.009,.035 2.1%,.141 4.4%,.723 12.9%,.938 16.7%,1.017,1.077,1.121,1.149 24.3%,1.159,1.163,1.161,1.154 29.9%,1.129 32.8%,1.051 39.6%,1.017 43.1%,.991,.977 51%,.974 53.8%,.975 57.1%,.997 69.8%,1.003 76.9%,1);--ease-spring-4:linear(0,.009,.037 1.7%,.153 3.6%,.776 10.3%,1.001,1.142 16%,1.185,1.209 19%,1.215 19.9% 20.8%,1.199,1.165 25%,1.056 30.3%,1.008 33%,.973,.955 39.2%,.953 41.1%,.957 43.3%,.998 53.3%,1.009 59.1% 63.7%,.998 78.9%,1);--ease-spring-5:linear(0,.01,.04 1.6%,.161 3.3%,.816 9.4%,1.046,1.189 14.4%,1.231,1.254 17%,1.259,1.257 18.6%,1.236,1.194 22.3%,1.057 27%,.999 29.4%,.955 32.1%,.942,.935 34.9%,.933,.939 38.4%,1 47.3%,1.011,1.017 52.6%,1.016 56.4%,1 65.2%,.996 70.2%,1.001 87.2%,1);--ease-bounce-1:linear(0,.004,.016,.035,.063,.098,.141,.191,.25,.316,.391 36.8%,.563,.766,1 58.8%,.946,.908 69.1%,.895,.885,.879,.878,.879,.885,.895,.908 89.7%,.946,1);--ease-bounce-2:linear(0,.004,.016,.035,.063,.098,.141 15.1%,.25,.391,.562,.765,1,.892 45.2%,.849,.815,.788,.769,.757,.753,.757,.769,.788,.815,.85,.892 75.2%,1 80.2%,.973,.954,.943,.939,.943,.954,.973,1);--ease-bounce-3:linear(0,.004,.016,.035,.062,.098,.141 11.4%,.25,.39,.562,.764,1 30.3%,.847 34.8%,.787,.737,.699,.672,.655,.65,.656,.672,.699,.738,.787,.847 61.7%,1 66.2%,.946,.908,.885 74.2%,.879,.878,.879,.885 79.5%,.908,.946,1 87.4%,.981,.968,.96,.957,.96,.968,.981,1);--ease-bounce-4:linear(0,.004,.016 3%,.062,.141,.25,.391,.562 18.2%,1 24.3%,.81,.676 32.3%,.629,.595,.575,.568,.575,.595,.629,.676 48.2%,.811,1 56.2%,.918,.86,.825,.814,.825,.86,.918,1 77.2%,.94 80.6%,.925,.92,.925,.94 87.5%,1 90.9%,.974,.965,.974,1);--ease-bounce-5:linear(0,.004,.016 2.5%,.063,.141,.25 10.1%,.562,1 20.2%,.783,.627,.534 30.9%,.511,.503,.511,.534 38%,.627,.782,1 48.7%,.892,.815,.769 56.3%,.757,.753,.757,.769 61.3%,.815,.892,1 68.8%,.908 72.4%,.885,.878,.885,.908 79.4%,1 83%,.954 85.5%,.943,.939,.943,.954 90.5%,1 93%,.977,.97,.977,1)}:where(:root){--palette-hue:250;--palette-hue-rotate-by:0;--palette-chroma:.15}*{--color-1:oklch(98% calc(.03*var(--palette-chroma,1))calc(var(--palette-hue) + (0*var(--palette-hue-rotate-by))));--color-2:oklch(97% calc(.06*var(--palette-chroma,1))calc(var(--palette-hue) + (1*var(--palette-hue-rotate-by))));--color-3:oklch(93% calc(.1*var(--palette-chroma,1))calc(var(--palette-hue) + (2*var(--palette-hue-rotate-by))));--color-4:oklch(84% calc(.12*var(--palette-chroma,1))calc(var(--palette-hue) + (3*var(--palette-hue-rotate-by))));--color-5:oklch(80% calc(.16*var(--palette-chroma,1))calc(var(--palette-hue) + (4*var(--palette-hue-rotate-by))));--color-6:oklch(71% calc(.19*var(--palette-chroma,1))calc(var(--palette-hue) + (5*var(--palette-hue-rotate-by))));--color-7:oklch(66% calc(.2*var(--palette-chroma,1))calc(var(--palette-hue) + (6*var(--palette-hue-rotate-by))));--color-8:oklch(58% calc(.21*var(--palette-chroma,1))calc(var(--palette-hue) + (7*var(--palette-hue-rotate-by))));--color-9:oklch(53% calc(.2*var(--palette-chroma,1))calc(var(--palette-hue) + (8*var(--palette-hue-rotate-by))));--color-10:oklch(49% calc(.19*var(--palette-chroma,1))calc(var(--palette-hue) + (9*var(--palette-hue-rotate-by))));--color-11:oklch(42% calc(.17*var(--palette-chroma,1))calc(var(--palette-hue) + (10*var(--palette-hue-rotate-by))));--color-12:oklch(35% calc(.15*var(--palette-chroma,1))calc(var(--palette-hue) + (11*var(--palette-hue-rotate-by))));--color-13:oklch(27% calc(.12*var(--palette-chroma,1))calc(var(--palette-hue) + (12*var(--palette-hue-rotate-by))));--color-14:oklch(20% calc(.09*var(--palette-chroma,1))calc(var(--palette-hue) + (13*var(--palette-hue-rotate-by))));--color-15:oklch(16% calc(.07*var(--palette-chroma,1))calc(var(--palette-hue) + (14*var(--palette-hue-rotate-by))));--color-16:oklch(10% calc(.05*var(--palette-chroma,1))calc(var(--palette-hue) + (15*var(--palette-hue-rotate-by))))}}
99
+
100
+ @layer openprops{
101
+ :where(:root) {
102
+ --size-xxs: 240px;
103
+ --size-xs: 360px;
104
+ --size-sm: 480px;
105
+ --size-md: 768px;
106
+ --size-lg: 1024px;
107
+ --size-xl: 1440px;
108
+ --size-xxl: 1920px;
109
+ }}
110
+
111
+ @layer openprops{
112
+ :where(:root) {
113
+ --font-lineheight-00: 0.95;
114
+ --font-lineheight-0: 1.1;
115
+ --font-lineheight-1: 1.25;
116
+ --font-lineheight-2: 1.375;
117
+ --font-lineheight-3: 1.5;
118
+ --font-lineheight-4: 1.75;
119
+ --font-lineheight-5: 2;
120
+ }}
121
+
122
+ @layer openprops{
123
+ :where(:root){--oklch-red:25;--oklch-pink:350;--oklch-purple:310;--oklch-violet:290;--oklch-indigo:270;--oklch-blue:240;--oklch-cyan:210;--oklch-teal:185;--oklch-green:145;--oklch-lime:125;--oklch-yellow:100;--oklch-orange:75}}
124
+
125
+ /* Normalize */
126
+
127
+ @layer normalize {
128
+ *,
129
+ ::before,
130
+ ::after {
131
+ /* Set box sizing instead of inheriting */
132
+ /* https://www.oddbird.net/2025/09/04/box-model/ */
133
+ box-sizing: border-box;
134
+ }
135
+
136
+ * {
137
+ scrollbar-width: thin;
138
+ }
139
+
140
+ :where(html) {
141
+ --_page-bg-color: var(--surface-default);
142
+
143
+ accent-color: var(--primary);
144
+ background-color: var(--_page-bg-color);
145
+ block-size: 100%;
146
+ caret-color: var(--primary);
147
+ color: var(--text-color-2);
148
+ font-family: var(--font-sans);
149
+ interpolate-size: allow-keywords;
150
+ line-height: var(--font-lineheight-4);
151
+
152
+ /* https://kilianvalkhof.com/2022/css-html/your-css-reset-needs-text-size-adjust-probably/ */
153
+ -moz-text-size-adjust: none;
154
+ -webkit-text-size-adjust: none;
155
+ text-size-adjust: none;
156
+
157
+ @media (--motionOK) {
158
+ scroll-behavior: smooth;
159
+ }
160
+ }
161
+
162
+ :where(body) {
163
+ -moz-osx-font-smoothing: grayscale;
164
+ -webkit-font-smoothing: antialiased;
165
+ container-type: inline-size;
166
+ font-size: 16px;
167
+ font-synthesis: style;
168
+ font-weight: 400;
169
+ inline-size: 100%;
170
+ margin: 0;
171
+ min-block-size: 100%;
172
+ min-inline-size: 320px;
173
+ position: relative;
174
+ text-rendering: optimizeLegibility;
175
+ }
176
+
177
+ /* TODO */
178
+ :where(:not(dialog, popover)) {
179
+ margin: 0;
180
+ }
181
+
182
+ :where(:not(fieldset, progress, meter)) {
183
+ background-origin: border-box;
184
+ background-repeat: no-repeat;
185
+ border-style: solid;
186
+ border-width: 0;
187
+ }
188
+
189
+ :where(fieldset) {
190
+ border: var(--field-border-width) solid var(--field-border-color);
191
+ border-radius: var(--field-border-radius);
192
+ padding: var(--size-3);
193
+ display: grid;
194
+ gap: var(--size-3);
195
+ }
196
+
197
+ :where(input, button, textarea),
198
+ :where(input[type="file"])::-webkit-file-upload-button {
199
+ color: inherit;
200
+ font-size: inherit;
201
+ font: inherit;
202
+ letter-spacing: inherit;
203
+ }
204
+
205
+ :where(input):-webkit-autofill,
206
+ :where(input):-webkit-autofill:hover,
207
+ :where(input):-webkit-autofill:focus,
208
+ :where(textarea):-webkit-autofill,
209
+ :where(textarea):-webkit-autofill:hover,
210
+ :where(textarea):-webkit-autofill:focus,
211
+ :where(select):-webkit-autofill,
212
+ :where(select):-webkit-autofill:hover,
213
+ :where(select):-webkit-autofill:focus,
214
+ :where(input):autofill,
215
+ :where(input):autofill:hover,
216
+ :where(input):autofill:focus,
217
+ :where(textarea):autofill,
218
+ :where(textarea):autofill:hover,
219
+ :where(textarea):autofill:focus,
220
+ :where(select):autofill,
221
+ :where(select):autofill:hover,
222
+ :where(select):autofill:focus {
223
+ -webkit-text-fill-color: var(--text-color-2);
224
+ -webkit-box-shadow: 0 0 0px 1e5px var(--well-1) inset;
225
+ transition: background-color 5000s ease-in-out 0s;
226
+ }
227
+
228
+ ::placeholder {
229
+ color: var(--text-color-2);
230
+ }
231
+
232
+ ::-moz-placeholder {
233
+ opacity: 1;
234
+ }
235
+
236
+ :focus-visible {
237
+ /* Inverts the --_page-bg-color */
238
+ --_focus-visible-color: rgb(
239
+ from var(--_page-bg-color) calc(255 - r) calc(255 - g) calc(255 - b)
240
+ );
241
+
242
+ border-radius: var(--border-radius, 0px);
243
+ outline: 2px solid var(--_focus-visible-color);
244
+ outline-offset: 2px;
245
+ }
246
+
247
+ @media (--motionOK) {
248
+ :where(:focus-visible) {
249
+ transition: outline-offset 145ms var(--ease-2);
250
+ }
251
+ :where(:not(:active):focus-visible) {
252
+ transition-duration: 0.15s;
253
+ }
254
+ }
255
+
256
+ :where(:not(:active):focus-visible) {
257
+ outline-offset: var(--outline-offset, 0px);
258
+ }
259
+
260
+ :where(
261
+ a[href],
262
+ area,
263
+ button,
264
+ input:not(
265
+ [type="text"],
266
+ [type="email"],
267
+ [type="number"],
268
+ [type="password"],
269
+ [type=""],
270
+ [type="tel"],
271
+ [type="url"]
272
+ ),
273
+ label[for],
274
+ select,
275
+ summary
276
+ ) {
277
+ cursor: pointer;
278
+ }
279
+
280
+ :where(
281
+ a[href],
282
+ area,
283
+ button,
284
+ [role="button"],
285
+ input,
286
+ label[for],
287
+ select,
288
+ summary,
289
+ textarea,
290
+ [tabindex]:not([tabindex*="-"])
291
+ ) {
292
+ -webkit-tap-highlight-color: transparent;
293
+ touch-action: manipulation;
294
+ }
295
+
296
+ :where(img, svg, video, canvas, audio, iframe, embed, object) {
297
+ display: block;
298
+ }
299
+
300
+ :where(img, svg, video) {
301
+ block-size: auto;
302
+ max-inline-size: 100%;
303
+ }
304
+
305
+ :where(svg:not([width])) {
306
+ inline-size: var(--size-7);
307
+ }
308
+
309
+ :where(dt:not(:first-of-type)) {
310
+ margin-block-start: var(--size-5);
311
+ }
312
+
313
+ :where(figure) {
314
+ display: grid;
315
+ gap: var(--size-2);
316
+ place-items: center;
317
+ }
318
+
319
+ :target {
320
+ scroll-margin-block-start: 2rem;
321
+ }
322
+ }
323
+
324
+ /* Theme */
325
+
326
+ /*
327
+ theme two theme setup
328
+ */
329
+
330
+ @layer theme {
331
+ .light {
332
+ --color-scheme: light;
333
+ }
334
+ .dark {
335
+ --color-scheme: dark;
336
+ }
337
+
338
+ :where(html) {
339
+ color-scheme: var(--color-scheme, light dark);
340
+
341
+ --palette-hue: var(--oklch-orange);
342
+ --palette-hue-rotate-by: 0;
343
+ --palette-chroma: 0.89;
344
+
345
+ /* Primary */
346
+ --primary: var(--color-8);
347
+ --primary-light: oklch(from var(--primary) calc(l * 1.25) c h);
348
+ --primary-dark: oklch(from var(--primary) calc(l * 0.75) c h);
349
+ --primary-contrast: var(--gray-1);
350
+
351
+ /* Text */
352
+ --text-color-1: light-dark(var(--gray-15), var(--gray-1));
353
+ --text-color-1-contrast: light-dark(var(--gray-2), var(--gray-15));
354
+ --text-color-2: light-dark(var(--gray-13), var(--gray-4));
355
+ --text-color-2-contrast: light-dark(var(--gray-4), var(--gray-13));
356
+
357
+ /* Surface */
358
+ --surface-default: light-dark(var(--gray-1), var(--gray-13));
359
+ --surface-filled: light-dark(var(--gray-3), var(--gray-15));
360
+ --surface-tonal: light-dark(var(--gray-3), var(--gray-12));
361
+ --surface-elevated: light-dark(var(--gray-1), var(--gray-12));
362
+
363
+ /* Shadows */
364
+ --shadow-color: light-dark(220 3% 15%, 220 40% 2%);
365
+ --shadow-strength: light-dark(1%, 10%);
366
+ --inner-shadow-highlight: light-dark(
367
+ inset 0 -0.5px 0 0 #fff,
368
+ inset 0 0.5px 0 0 #0001,
369
+ inset 0 -0.5px 0 0 #fff1,
370
+ inset 0 0.5px 0 0 #0007
371
+ );
372
+
373
+ /* Typography */
374
+ --font-size-h1: var(--font-size-fluid-3, 3.5rem);
375
+ --font-size-h2: var(--font-size-fluid-2, 2rem);
376
+ --font-size-h3: var(--font-size-fluid-1, 1.5rem);
377
+ --font-size-h4: var(--font-size-3, 1.25rem);
378
+ --font-size-h5: var(--font-size-2, 1.1rem);
379
+ --font-size-h6: var(--font-size-fluid-0, 1rem);
380
+ --font-size-lg: var(--font-size-3, 1.25rem);
381
+ --font-size-md: var(--font-size-fluid-0, 1rem);
382
+ --font-size-sm: 0.875rem;
383
+ --font-size-xs: var(--font-size-0, 0.75rem);
384
+
385
+ /* Borders */
386
+ --border-color: light-dark(var(--gray-4), var(--gray-12));
387
+ --border-radius: var(--size-2);
388
+ --border-width: 1px;
389
+
390
+ /* Input Field */
391
+ --field-border-color: var(--border-color);
392
+ --field-border-radius: var(--size-2);
393
+ --field-border-width: 1px;
394
+ --field-size: 2.3lh;
395
+ --field-size-small: 1.9lh;
396
+
397
+ /* Button */
398
+ --button-border-radius: var(--size-2);
399
+ }
400
+
401
+ /* Highlight colors */
402
+ :where(.red, .error, del) {
403
+ --palette-hue: var(--oklch-red, 25);
404
+ --palette-chroma: 1;
405
+ --palette-hue-rotate-by: 1;
406
+ }
407
+ :where(.blue, .ok, abbr, dfn) {
408
+ --palette-hue: var(--oklch-blue, 210);
409
+ --palette-chroma: 1;
410
+ --palette-hue-rotate-by: 1;
411
+ }
412
+ :where(.green, .good, ins) {
413
+ --palette-hue: var(--oklch-green, 145);
414
+ --palette-chroma: 1;
415
+ --palette-hue-rotate-by: 1;
416
+ }
417
+ :where(.orange, .warning) {
418
+ --palette-hue: var(--oklch-orange, 75);
419
+ --palette-chroma: 1;
420
+ --palette-hue-rotate-by: 1;
421
+ }
422
+
423
+ :where(html) {
424
+ --red: oklch(from var(--color-9) l 0.2 25);
425
+ --blue: oklch(from var(--color-9) l 0.2 210);
426
+ --green: oklch(from var(--color-9) l 0.2 145);
427
+ --orange: oklch(from var(--color-7) l 0.2 75);
428
+ }
429
+
430
+ /* Gray palette */
431
+ :where(html) {
432
+ --gray-chroma: 0.01;
433
+ --gray-lightness: 255;
434
+
435
+ --gray-1: oklch(
436
+ from var(--color-1) l var(--gray-chroma) var(--gray-lightness)
437
+ );
438
+ --gray-2: oklch(
439
+ from var(--color-2) l var(--gray-chroma) var(--gray-lightness)
440
+ );
441
+ --gray-3: oklch(
442
+ from var(--color-3) l var(--gray-chroma) var(--gray-lightness)
443
+ );
444
+ --gray-4: oklch(
445
+ from var(--color-4) l var(--gray-chroma) var(--gray-lightness)
446
+ );
447
+ --gray-5: oklch(
448
+ from var(--color-5) l var(--gray-chroma) var(--gray-lightness)
449
+ );
450
+ --gray-6: oklch(
451
+ from var(--color-6) l var(--gray-chroma) var(--gray-lightness)
452
+ );
453
+ --gray-7: oklch(
454
+ from var(--color-7) l var(--gray-chroma) var(--gray-lightness)
455
+ );
456
+ --gray-8: oklch(
457
+ from var(--color-8) l var(--gray-chroma) var(--gray-lightness)
458
+ );
459
+ --gray-9: oklch(
460
+ from var(--color-9) l var(--gray-chroma) var(--gray-lightness)
461
+ );
462
+ --gray-10: oklch(
463
+ from var(--color-10) l var(--gray-chroma) var(--gray-lightness)
464
+ );
465
+ --gray-11: oklch(
466
+ from var(--color-11) l var(--gray-chroma) var(--gray-lightness)
467
+ );
468
+ --gray-12: oklch(
469
+ from var(--color-12) l var(--gray-chroma) var(--gray-lightness)
470
+ );
471
+ --gray-13: oklch(
472
+ from var(--color-13) l var(--gray-chroma) var(--gray-lightness)
473
+ );
474
+ --gray-14: oklch(
475
+ from var(--color-14) l var(--gray-chroma) var(--gray-lightness)
476
+ );
477
+ --gray-15: oklch(
478
+ from var(--color-15) l var(--gray-chroma) var(--gray-lightness)
479
+ );
480
+ --gray-16: oklch(
481
+ from var(--color-16) l var(--gray-chroma) var(--gray-lightness)
482
+ );
483
+ }
484
+ }
485
+
486
+ /* Components */
487
+
488
+ /*
489
+ * Components are divided into two categories - if they are stand-alone (root) or if they are built on top of others (extended).
490
+ */
491
+
492
+ /*** Root components (no dependencies) */
493
+
494
+ @layer components.root {
495
+ :where(.button) {
496
+ --_bg-color: transparent;
497
+ --_border-color: transparent;
498
+ --_border-radius: var(--button-border-radius);
499
+ --_font-size: initial;
500
+ --_min-height: 2.375rem;
501
+ --_text-color: var(--primary);
502
+
503
+ -webkit-tap-highlight-color: transparent;
504
+ -webkit-touch-callout: none;
505
+ align-items: center;
506
+ background: var(--_bg-color) var(--ripple, none);
507
+ border-radius: var(--_border-radius);
508
+ border: var(--border-size-1) solid var(--_border-color);
509
+ color: var(--_text-color);
510
+ display: inline-flex;
511
+ font-size: var(--_font-size);
512
+ font-weight: 700;
513
+ gap: var(--size-2);
514
+ justify-content: center;
515
+ min-block-size: var(--_min-height);
516
+ padding-block: 0.5ex;
517
+ padding-inline: 1.5ex;
518
+ text-align: center;
519
+ text-decoration: none;
520
+
521
+ user-select: none;
522
+
523
+ &:where([disabled]) {
524
+ cursor: not-allowed;
525
+ opacity: 0.64;
526
+ }
527
+
528
+ @media (prefers-reduced-motion: no-preference) {
529
+ transition:
530
+ background-color 0.2s var(--ease-out-3),
531
+ box-shadow 0.2s var(--ease-out-3),
532
+ border-color 0.2s var(--ease-out-3),
533
+ color 0.2s var(--ease-out-3),
534
+ outline-offset 0.05s var(--ease-1);
535
+
536
+ /* Ripple effect */
537
+ background-position: center;
538
+
539
+ &:where(:not([disabled])) {
540
+ &:where(:not(:active):hover) {
541
+ --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%)
542
+ center/15000%;
543
+
544
+ transition: background var(--button-ripple-duration);
545
+ }
546
+
547
+ &:where(:hover:active) {
548
+ background-size: var(--button-ripple-size);
549
+ transition: background 0s;
550
+ }
551
+ }
552
+ }
553
+
554
+ /* Element states */
555
+ &:where(:not([disabled])) {
556
+ &:where(:not(:active):hover) {
557
+ --_bg-color: light-dark(
558
+ oklch(from var(--primary) l 0.01 h / 20%),
559
+ oklch(from var(--primary) l 0.01 h / 40%)
560
+ );
561
+ }
562
+
563
+ &:where(:hover:active) {
564
+ --_bg-color: light-dark(
565
+ oklch(from var(--primary) l 0.06 h / 30%),
566
+ oklch(from var(--primary) l 0.06 h / 40%)
567
+ );
568
+ }
569
+ }
570
+
571
+ /* Disabled */
572
+ &:where([disabled]) {
573
+ --_text-color: color-mix(
574
+ in oklch,
575
+ var(--text-color-2) 50%,
576
+ var(--surface-default)
577
+ );
578
+ }
579
+
580
+ /* Icon */
581
+ &:where(:has(svg), &.icon-only) {
582
+ gap: 1ex;
583
+
584
+ svg {
585
+ max-block-size: 0.7lh;
586
+ color: currentColor;
587
+ }
588
+ }
589
+
590
+ /* Keyboard input */
591
+ :is(kbd) {
592
+ background-color: inherit;
593
+ border-color: currentColor;
594
+ color: inherit;
595
+ font-size: 0.85em;
596
+ line-height: 1.2;
597
+ }
598
+
599
+ /* Sizes */
600
+ &.small {
601
+ --_min-height: 1.875rem;
602
+ padding-block: 0;
603
+ padding-inline: 1ex;
604
+ }
605
+
606
+ &.large {
607
+ --_min-height: 2.875rem;
608
+ padding-inline: 4ex;
609
+ }
610
+
611
+ /* Variants */
612
+ &.outlined {
613
+ --_bg-color: var(--surface-default);
614
+ --_border-color: var(--color-8);
615
+ --_text-color: var(--color-8);
616
+
617
+ &:where(:not([disabled])) {
618
+ &:where(:not(:active):hover) {
619
+ --_bg-color: var(--color-10);
620
+ --_border-color: var(--color-10);
621
+ --_text-color: var(--color-1);
622
+ }
623
+
624
+ &:where(:active) {
625
+ --_bg-color: var(--color-9);
626
+ --_border-color: var(--color-9);
627
+ --_text-color: var(--color-1);
628
+ }
629
+ }
630
+
631
+ &:where([disabled]) {
632
+ --_bg-color: var(--surface-default);
633
+ --_border-color: color-mix(
634
+ in oklch,
635
+ var(--text-color-2) 20%,
636
+ var(--surface-default)
637
+ );
638
+ --_text-color: color-mix(
639
+ in oklch,
640
+ var(--text-color-2) 40%,
641
+ var(--surface-default)
642
+ );
643
+ }
644
+ }
645
+ &.tonal {
646
+ --_bg-color: var(--color-6);
647
+ --_text-color: var(--color-16);
648
+
649
+ &:where(:not([disabled])) {
650
+ &:where(:not(:active):hover) {
651
+ --_bg-color: var(--color-9);
652
+ --_border-color: var(--color-9);
653
+ }
654
+
655
+ &:where(:active) {
656
+ --_bg-color: var(--color-7);
657
+ --_border-color: var(--color-7);
658
+ }
659
+ }
660
+
661
+ &:where([disabled]) {
662
+ --_bg-color: color-mix(
663
+ in oklch,
664
+ var(--text-color-2) 8%,
665
+ var(--surface-default)
666
+ );
667
+ --_text-color: color-mix(
668
+ in oklch,
669
+ var(--text-color-2) 70%,
670
+ var(--surface-default)
671
+ );
672
+ }
673
+ }
674
+ &.filled {
675
+ --_bg-color: var(--color-8);
676
+ --_text-color: var(--color-1);
677
+
678
+ &:where(:not([disabled])) {
679
+ &:where(:not(:active):hover) {
680
+ --_bg-color: var(--color-10);
681
+ --_border-color: var(--color-10);
682
+ }
683
+
684
+ &:where(:active) {
685
+ --_bg-color: var(--color-9);
686
+ --_border-color: var(--color-9);
687
+ }
688
+ }
689
+
690
+ &:where([disabled]) {
691
+ --_bg-color: color-mix(
692
+ in oklch,
693
+ var(--text-color-2) 20%,
694
+ var(--surface-default)
695
+ );
696
+ --_text-color: color-mix(
697
+ in oklch,
698
+ var(--text-color-2) 70%,
699
+ var(--surface-default)
700
+ );
701
+ }
702
+ }
703
+ }
704
+
705
+ /* file input */
706
+ :where(input[type="file"]) {
707
+ align-self: flex-start;
708
+ border-radius: var(--radius-2);
709
+ border: var(--border-size-1) solid var(--surface-filled);
710
+ box-shadow: var(--inner-shadow-4);
711
+ color: var(--text-color-2-contrast);
712
+ cursor: initial;
713
+ max-inline-size: 100%;
714
+ padding: 0;
715
+ }
716
+
717
+ :where(input[type="file"])::-webkit-file-upload-button,
718
+ :where(input[type="file"])::file-selector-button {
719
+ cursor: pointer;
720
+ margin-inline-end: var(--size-relative-6);
721
+ }
722
+ }
723
+
724
+ @layer components.root {
725
+ :where(.icon-button) {
726
+ --_text-color: inherit;
727
+
728
+ align-items: center;
729
+ aspect-ratio: 1;
730
+ background-color: transparent;
731
+ border: 0;
732
+ border-radius: var(--radius-round);
733
+ display: inline-flex;
734
+ inline-size: var(--size-6);
735
+ justify-content: center;
736
+ padding: 0;
737
+ transform-style: preserve-3d;
738
+
739
+ &:where([disabled]) {
740
+ color: light-dark(rgb(0, 0, 0/0.3), rgb(255, 255, 255/0.26));
741
+ cursor: not-allowed;
742
+ opacity: 0.64;
743
+ }
744
+
745
+ svg {
746
+ max-inline-size: var(--size-5);
747
+ pointer-events: none;
748
+ }
749
+
750
+ /* Ripple effect, utils.css */
751
+ &::before {
752
+ --highlight-size: 130%;
753
+ }
754
+
755
+ /* Size */
756
+ &.small {
757
+ inline-size: var(--size-4);
758
+ svg {
759
+ max-inline-size: var(--size-4);
760
+ }
761
+ }
762
+ }
763
+ }
764
+
765
+ @layer components.root {
766
+ :where(nav.tabs) {
767
+ --_bg-color: transparent;
768
+
769
+ & > [role="tablist"] {
770
+ button {
771
+ outline-color: transparent;
772
+ outline-offset: -4px;
773
+
774
+ &[aria-selected="true"] {
775
+ &:focus-visible {
776
+ outline: 2px solid var(--text-color-1);
777
+ }
778
+ }
779
+ }
780
+ }
781
+
782
+ /* Underlined */
783
+ &.underlined {
784
+ /* Tab list */
785
+ & > [role="tablist"] {
786
+ border-bottom: 1px solid var(--border-color);
787
+
788
+ button {
789
+ --_ripple-color: light-dark(
790
+ color-mix(in oklch, var(--gray-2) 80%, var(--color-8)),
791
+ color-mix(in oklch, var(--gray-13) 80%, var(--color-8))
792
+ );
793
+
794
+ background: var(--_bg-color) var(--ripple, none);
795
+ font-weight: 500;
796
+ line-height: var(--font-lineheight-4);
797
+ padding: var(--size-2) var(--size-3);
798
+
799
+ &:focus-visible {
800
+ border-radius: 0;
801
+ }
802
+
803
+ &[aria-selected="true"] {
804
+ border-block-end: 2px solid var(--primary);
805
+ color: var(--primary);
806
+ }
807
+
808
+ @media (prefers-reduced-motion: no-preference) {
809
+ transition: background-color 0.2s var(--ease-out-3),
810
+ border-color 0.2s var(--ease-out-3), color 0.2s var(--ease-out-3),
811
+ outline-offset 0.05s var(--ease-1);
812
+
813
+ /*** Ripple effect */
814
+ background-position: center;
815
+ transition: background var(--button-ripple-duration);
816
+ &:where(:not(:active):hover) {
817
+ --ripple: radial-gradient(
818
+ circle,
819
+ transparent 1%,
820
+ var(--_ripple-color) 1%
821
+ )
822
+ center/15000%;
823
+ }
824
+
825
+ &:where(:hover:active) {
826
+ background-size: var(--button-ripple-size);
827
+ transition: background 0s;
828
+ }
829
+
830
+ &:hover {
831
+ background-color: light-dark(
832
+ oklch(from var(--primary) calc(l * 0.75) none h / 5%),
833
+ oklch(from var(--primary) calc(l * 1.25) none h / 5%)
834
+ );
835
+ }
836
+ }
837
+ }
838
+ }
839
+ }
840
+
841
+ /* Filled */
842
+ &.filled {
843
+ --_bg-color: var(--surface-default);
844
+ --_radius: var(--border-radius);
845
+ --_selected-bg: var(--surface-filled);
846
+
847
+ & > [role="tablist"] {
848
+ background-color: var(--_bg-color);
849
+ border: var(--border-width) solid var(--border-color);
850
+ border-radius: var(--_radius);
851
+ overflow: hidden;
852
+ padding: 0.792ex;
853
+ width: fit-content;
854
+
855
+ button {
856
+ background-color: var(--_bg-color);
857
+ border-radius: var(--_radius);
858
+ line-height: var(--font-lineheight-4);
859
+ padding-inline: var(--size-3);
860
+
861
+ &:hover {
862
+ background-color: oklch(from var(--_bg-color) calc(l * 1.25) c h);
863
+ }
864
+
865
+ &[aria-selected="true"] {
866
+ background-color: var(--_selected-bg);
867
+
868
+ &:hover {
869
+ background-color: oklch(
870
+ from var(--_selected-bg) calc(l * 1.25) c h
871
+ );
872
+ }
873
+ }
874
+
875
+ @media (prefers-reduced-motion: no-preference) {
876
+ transition: background-color 0.2s var(--ease-out-3),
877
+ border-color 0.2s var(--ease-out-3), color 0.2s var(--ease-out-3),
878
+ outline-offset 0.05s var(--ease-1);
879
+ }
880
+ }
881
+ }
882
+ }
883
+ }
884
+ }
885
+
886
+ @layer components.root {
887
+ :where([role="group"].toggle-button-group) {
888
+ --_border-radius: var(--button-border-radius);
889
+ --_button-padding-inline: clamp(var(--size-2), 3cqi, var(--size-4));
890
+ --_max-width: auto;
891
+ --_icon-size: var(--size-4);
892
+
893
+ background-color: var(--surface-default);
894
+ border: 1px solid var(--border-color);
895
+ border-radius: var(--_border-radius);
896
+ display: flex;
897
+ grid-auto-columns: 1fr;
898
+ grid-auto-flow: column;
899
+ max-inline-size: var(--_max-width);
900
+ min-inline-size: max-content;
901
+ overflow: clip;
902
+
903
+ /* Size */
904
+ &.small {
905
+ button {
906
+ min-block-size: 2.1875rem; /* 35px */
907
+ }
908
+ }
909
+
910
+ &.x-small {
911
+ button {
912
+ min-block-size: var(--size-6); /* 30px */
913
+ }
914
+ }
915
+
916
+ &.fullwidth {
917
+ inline-size: 100%;
918
+ }
919
+
920
+ /* Button */
921
+ button {
922
+ --_bg-color: transparent;
923
+
924
+ align-items: center;
925
+ background: var(--_bg-color) var(--ripple, none);
926
+ border-radius: 0;
927
+ border-inline: 1px solid var(--border-color);
928
+ border-inline-start-width: 0;
929
+ color: var(--text-color-1);
930
+ display: inline-flex;
931
+ flex: auto;
932
+ gap: 1ex;
933
+ justify-content: center;
934
+ min-block-size: 2.5rem; /* 40px */
935
+ min-inline-size: 5ex;
936
+ outline-offset: calc(-1 * var(--size-2));
937
+ padding: 0 var(--_button-padding-inline);
938
+ position: relative;
939
+ user-select: none;
940
+
941
+ @media (prefers-reduced-motion: no-preference) {
942
+ transition: background-color 0.2s var(--ease-out-3),
943
+ box-shadow 0.2s var(--ease-out-3), border-color 0.2s var(--ease-out-3),
944
+ color 0.2s var(--ease-out-3), outline-offset 0.05s var(--ease-1);
945
+ }
946
+
947
+ /* Element states */
948
+ &:hover {
949
+ --_bg-color: light-dark(oklch(0% 0 0 / 0.04), oklch(100% 0 0 / 0.08));
950
+ }
951
+
952
+ &:focus-visible {
953
+ outline-offset: -6px;
954
+ }
955
+
956
+ /* Disabled */
957
+ &[disabled] {
958
+ border-color: color-mix(in oklch, var(--border-color) 50%, transparent);
959
+ cursor: not-allowed;
960
+ color: color-mix(in oklch, var(--text-color-1) 30%, transparent);
961
+ }
962
+
963
+ &[disabled] + &:not([disabled]):not(:last-of-type) {
964
+ border-inline-end-width: 1px;
965
+ }
966
+
967
+ /* Assign border radius for outline */
968
+ &:first-of-type {
969
+ border-bottom-left-radius: var(--_border-radius);
970
+ border-top-left-radius: var(--_border-radius);
971
+ }
972
+ &:last-of-type {
973
+ border-bottom-right-radius: var(--_border-radius);
974
+ border-top-right-radius: var(--_border-radius);
975
+ }
976
+
977
+ &:last-of-type {
978
+ border-inline-end-width: 0;
979
+ }
980
+
981
+ /* Ripple effect */
982
+ background-position: center;
983
+
984
+ &:where(:not([disabled])) {
985
+ &:where(:not(:active):hover) {
986
+ --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%)
987
+ center/15000%;
988
+
989
+ transition: background var(--button-ripple-duration);
990
+ }
991
+
992
+ &:where(:hover:active) {
993
+ background-size: var(--button-ripple-size);
994
+ transition: background 0s;
995
+ }
996
+ }
997
+
998
+ /* Icons */
999
+ svg {
1000
+ inline-size: var(--_icon-size);
1001
+ inset-inline-start: calc(var(--_button-padding-inline));
1002
+
1003
+ & + svg {
1004
+ max-block-size: var(--size-5);
1005
+ max-inline-size: var(--size-7);
1006
+ }
1007
+ }
1008
+
1009
+ /* Selected */
1010
+ &.selected {
1011
+ --_bg-color: oklch(from var(--primary) l c h / 25%);
1012
+
1013
+ /* Checkmark */
1014
+ svg:first-of-type {
1015
+ margin-block-end: -3px;
1016
+ }
1017
+ }
1018
+ }
1019
+ }
1020
+ }
1021
+
1022
+ @layer components.root {
1023
+ :where(.avatar) {
1024
+ --_bg-color: var(--color-8);
1025
+ --_color: var(--text-color-1);
1026
+ --_width: 40px;
1027
+
1028
+ align-items: center;
1029
+ background-color: var(--_bg-color);
1030
+ color: var(--_color);
1031
+ aspect-ratio: 1;
1032
+ border-radius: 100vmax;
1033
+ display: inline-flex;
1034
+ inline-size: var(--_width);
1035
+ justify-content: center;
1036
+ overflow: clip;
1037
+ position: relative;
1038
+ text-align: center;
1039
+ text-decoration: none;
1040
+
1041
+ &:has(img) {
1042
+ background-color: transparent;
1043
+ }
1044
+
1045
+ svg {
1046
+ max-inline-size: var(--size-5);
1047
+ }
1048
+
1049
+ img {
1050
+ block-size: 100%;
1051
+ inline-size: 100%;
1052
+ inset: 0;
1053
+ object-fit: cover;
1054
+ position: absolute;
1055
+ }
1056
+
1057
+ &.squared {
1058
+ border-radius: 0;
1059
+ }
1060
+
1061
+ &.rounded {
1062
+ border-radius: var(--border-size-3);
1063
+ }
1064
+ }
1065
+
1066
+ /*
1067
+ TODO: implement reading-order if that becomes a thing.
1068
+ https://developer.chrome.com/blog/reading-order/
1069
+ */
1070
+ :where(.avatar-group) {
1071
+ --_margin: var(--size-1);
1072
+
1073
+ display: flex;
1074
+ flex-direction: row-reverse;
1075
+
1076
+ &.gap-small {
1077
+ --_margin: var(--size-2);
1078
+ }
1079
+
1080
+ &.gap-x-small {
1081
+ --_margin: var(--size-3);
1082
+ }
1083
+
1084
+ .avatar {
1085
+ margin-inline-end: calc(-1 * var(--_margin));
1086
+ outline: 2px solid var(--surface-default);
1087
+ }
1088
+ }
1089
+ }
1090
+
1091
+ @layer components.root {
1092
+ :where(.badge) {
1093
+ --_bg-color: var(--primary);
1094
+ --_border-color: var(--primary);
1095
+ --_color: var(--gray-1);
1096
+ --_inset-offset: 16px;
1097
+ --_inset: auto auto calc(100% - var(--_inset-offset))
1098
+ calc(100% - var(--_inset-offset));
1099
+ --_translate: 0;
1100
+
1101
+ display: inline-flex;
1102
+ position: relative;
1103
+
1104
+ &::after {
1105
+ background-color: var(--_bg-color);
1106
+ border: 2px solid var(--_border-color);
1107
+ border-radius: 100vmax;
1108
+ color: var(--_color);
1109
+ content: attr(aria-label);
1110
+ font-size: 12px;
1111
+ font-weight: 500;
1112
+ block-size: var(--size-4);
1113
+ line-height: normal;
1114
+ min-inline-size: var(--size-4, 1.125rem);
1115
+ padding-inline: var(--size-1);
1116
+ inset: var(--_inset);
1117
+ position: absolute;
1118
+ text-align: center;
1119
+ translate: var(--_translate);
1120
+ transition: opacity 0.2s var(--ease-out-1);
1121
+ inline-size: max-content;
1122
+ }
1123
+
1124
+ /* Alignment */
1125
+ &.start-start {
1126
+ --_inset: auto calc(100% - var(--_inset-offset))
1127
+ calc(100% - var(--_inset-offset)) auto;
1128
+ }
1129
+ &.start-end {
1130
+ --_inset: auto auto calc(100% - var(--_inset-offset))
1131
+ calc(100% - var(--_inset-offset));
1132
+ }
1133
+ &.end-start {
1134
+ --_inset: calc(100% - var(--_inset-offset))
1135
+ calc(100% - var(--_inset-offset)) auto auto;
1136
+ }
1137
+ &.end-end {
1138
+ --_inset: calc(100% - var(--_inset-offset)) auto auto
1139
+ calc(100% - var(--_inset-offset));
1140
+ }
1141
+
1142
+ /* Dot */
1143
+ &.dot {
1144
+ --_inset: 0 -1px auto auto;
1145
+ &::after {
1146
+ content: "";
1147
+ min-inline-size: var(--size-2);
1148
+ block-size: var(--size-2);
1149
+ inline-size: var(--size-2);
1150
+ padding: 0;
1151
+ }
1152
+ }
1153
+
1154
+ /* Visibility */
1155
+ &.invisible {
1156
+ &::after {
1157
+ opacity: 0;
1158
+ pointer-events: none;
1159
+ }
1160
+ }
1161
+
1162
+ /* Colors */
1163
+ &.error,
1164
+ &.good,
1165
+ &.ok,
1166
+ &.warning {
1167
+ --_bg-color: var(--color-8);
1168
+ --_border-color: var(--color-8);
1169
+ }
1170
+ }
1171
+
1172
+ [dir="rtl"] {
1173
+ :where(.badge) {
1174
+ --_inset: auto calc(100% - 16px) calc(100% - 16px) auto;
1175
+
1176
+ /* Alignment */
1177
+ &.start-start {
1178
+ --_inset: auto auto calc(100% - 16px) calc(100% - 16px);
1179
+ }
1180
+ &.start-end {
1181
+ --_inset: auto calc(100% - 16px) calc(100% - 16px) auto;
1182
+ }
1183
+ &.end-start {
1184
+ --_inset: calc(100% - 16px) auto auto calc(100% - 16px);
1185
+ }
1186
+ &.end-end {
1187
+ --_inset: calc(100% - 16px) calc(100% - 16px) auto auto;
1188
+ }
1189
+ }
1190
+ }
1191
+ }
1192
+
1193
+ @layer components.root {
1194
+ :where(.card) {
1195
+ --_bg-color: transparent;
1196
+ --_border-color: transparent;
1197
+ --_border-width: 0;
1198
+ --_shadow: none;
1199
+
1200
+ background-color: var(--_bg-color);
1201
+ border-color: var(--_border-color);
1202
+ border-radius: var(--border-radius, 0.25rem);
1203
+ border-style: solid;
1204
+ border-width: var(--_border-width);
1205
+ box-shadow: var(--_shadow);
1206
+ display: flex;
1207
+ flex-direction: column;
1208
+ gap: var(--size-3);
1209
+ overflow: hidden;
1210
+ padding-inline: 0;
1211
+
1212
+ /* Variants */
1213
+ &.text {
1214
+ --_bg-color: transparent;
1215
+ --_border-color: transparent;
1216
+ --_border-width: 0;
1217
+ --_shadow: none;
1218
+ padding-inline: 0;
1219
+ }
1220
+
1221
+ &.tonal {
1222
+ --_bg-color: var(--surface-tonal);
1223
+ --_border-width: 1px;
1224
+ }
1225
+
1226
+ &.elevated {
1227
+ --_bg-color: var(--surface-elevated);
1228
+ --_border-color: transparent;
1229
+ --_border-width: 0;
1230
+ --_shadow: var(--shadow-3);
1231
+
1232
+ /* Adjust shadow in dark mode */
1233
+ @container style(--color-scheme: dark) {
1234
+ --_shadow: var(--shadow-4);
1235
+ }
1236
+ }
1237
+
1238
+ &.outlined {
1239
+ --_bg-color: var(--surface-default);
1240
+ --_border-color: var(--border-color);
1241
+ --_border-width: 1px;
1242
+ }
1243
+
1244
+ & > :where(hgroup, .content) {
1245
+ padding-inline: var(--size-3);
1246
+ }
1247
+
1248
+ & > hgroup {
1249
+ padding-block: var(--size-3) 0;
1250
+
1251
+ /* Top paragraph */
1252
+ & > p:first-of-type:first-child {
1253
+ line-height: 1.3;
1254
+ }
1255
+
1256
+ /* Bottom paragraph */
1257
+ & > p:last-of-type:last-child:not(:first-child) {
1258
+ font-size: var(--font-size-1, 1rem);
1259
+ }
1260
+ }
1261
+
1262
+ & > .content:where(:only-child, :first-child) {
1263
+ padding-block: var(--size-3) var(--size-4);
1264
+ }
1265
+
1266
+ & > .actions {
1267
+ display: flex;
1268
+ gap: var(--size-1);
1269
+ margin-block: var(--size-2) 0;
1270
+ padding-block-end: var(--size-1);
1271
+ padding-inline: var(--size-1) var(--size-3);
1272
+ }
1273
+ }
1274
+ }
1275
+
1276
+ @layer components.root {
1277
+ :where(.chip) {
1278
+ --_bg-color: var(--surface-tonal);
1279
+ --_border-color: var(--border-color);
1280
+ --_color: var(--text-color-1);
1281
+
1282
+ align-items: center;
1283
+ background: var(--_bg-color) var(--ripple, none);
1284
+ border: 1px solid var(--_border-color);
1285
+ border-radius: var(--radius-2, 0.5rem);
1286
+ color: var(--_color);
1287
+ display: inline-flex;
1288
+ font-size: var(--font-size-0, 0.75rem);
1289
+ gap: var(--size-1);
1290
+ block-size: var(--size-7, 2rem);
1291
+ padding-inline: var(--size-2);
1292
+ text-decoration: none;
1293
+
1294
+ /* Variants */
1295
+ &.tonal {
1296
+ --_bg-color: var(--surface-tonal);
1297
+ --_color: var(--text-color-1);
1298
+ }
1299
+
1300
+ &.outlined {
1301
+ --_bg-color: var(--surface-default);
1302
+ --_color: var(--text-color-1);
1303
+ }
1304
+
1305
+ /* TODO: should this be out of the box? */
1306
+ /* Colors */
1307
+ /* &:hover {
1308
+ --_bg-color: var(--color-11);
1309
+ --_border-color: var(--color-11);
1310
+ --_color: var(--text-color-1);
1311
+ } */
1312
+ /* &.red,
1313
+ &.blue,
1314
+ &.green,
1315
+ &.orange,
1316
+ &.primary {
1317
+ --_bg-color: var(--color-5);
1318
+ --_border-color: var(--color-7);
1319
+ --_color: var(--text-color-1-contrast);
1320
+
1321
+ &:hover {
1322
+ --_bg-color: var(--color-7);
1323
+ --_border-color: var(--color-7);
1324
+ --_color: var(--text-color-1-contrast);
1325
+
1326
+ &:active {
1327
+ --_bg-color: var(--color-8);
1328
+ --_border-color: var(--color-8);
1329
+ }
1330
+ }
1331
+
1332
+ &.outlined {
1333
+ --_bg-color: var(--surface-tonal);
1334
+ --_color: var(--text-color-1);
1335
+ --_border-color: var(--color-9);
1336
+
1337
+ &:hover {
1338
+ --_bg-color: var(--color-9);
1339
+ --_border-color: var(--color-9);
1340
+ --_color: var(--text-color-1);
1341
+
1342
+ &:active {
1343
+ --_bg-color: var(--color-11);
1344
+ --_border-color: var(--color-11);
1345
+ }
1346
+ }
1347
+ }
1348
+ } */
1349
+
1350
+ &:where(button, a):where(:not([disabled])) {
1351
+ &:where(:not(:active)):hover {
1352
+ --_bg-color: light-dark(
1353
+ oklch(from var(--surface-tonal) calc(l * 0.98) c h),
1354
+ oklch(from var(--surface-tonal) calc(l * 1.1) c h)
1355
+ );
1356
+ }
1357
+ }
1358
+
1359
+ /* Icon */
1360
+ &:has(svg:first-child) {
1361
+ padding-inline: var(--size-1) var(--size-2);
1362
+ }
1363
+ &:has(svg:last-child) {
1364
+ padding-inline: var(--size-2) var(--size-1);
1365
+ }
1366
+
1367
+ &:has(svg) {
1368
+ svg {
1369
+ flex-shrink: 0;
1370
+ inline-size: var(--size-3);
1371
+ }
1372
+ }
1373
+
1374
+ /* Sizes */
1375
+ &.small {
1376
+ block-size: var(--size-5);
1377
+ }
1378
+ &.multiline {
1379
+ block-size: auto;
1380
+ }
1381
+
1382
+ /* Ripple effect */
1383
+ background-position: center;
1384
+
1385
+ &:where(:not([disabled])) {
1386
+ &:where(:not(:active):hover) {
1387
+ --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%)
1388
+ center/15000%;
1389
+
1390
+ transition: background var(--button-ripple-duration);
1391
+ }
1392
+
1393
+ &:where(:hover:active) {
1394
+ background-size: var(--button-ripple-size);
1395
+ transition: background 0s;
1396
+ }
1397
+ }
1398
+
1399
+ /* Disabled */
1400
+ &:where([disabled]) {
1401
+ opacity: 0.64;
1402
+ --_text-color: color-mix(
1403
+ in oklch,
1404
+ var(--text-color-2) 50%,
1405
+ var(--surface-default)
1406
+ );
1407
+ cursor: not-allowed;
1408
+ }
1409
+ }
1410
+ }
1411
+
1412
+ @layer components.root {
1413
+ :where(.definition-list) {
1414
+ --_border-style: solid;
1415
+ --_border-width: 1px;
1416
+
1417
+ display: grid;
1418
+ gap: var(--size-3);
1419
+ padding: 0;
1420
+
1421
+ &.dotted {
1422
+ --_border-style: dotted;
1423
+ --_border-width: 2px;
1424
+ }
1425
+
1426
+ li {
1427
+ display: grid;
1428
+ margin: 0;
1429
+ padding: 0;
1430
+
1431
+ .term {
1432
+ display: block;
1433
+ font-weight: 700;
1434
+ overflow: hidden;
1435
+ position: relative;
1436
+ }
1437
+
1438
+ hr {
1439
+ display: none;
1440
+ margin: 0;
1441
+ }
1442
+ }
1443
+
1444
+ @container (width > 45ch) {
1445
+ gap: var(--size-1);
1446
+
1447
+ li {
1448
+ align-items: baseline;
1449
+ display: grid;
1450
+ gap: var(--size-1);
1451
+ grid-template-columns: 1fr auto;
1452
+
1453
+ &:has(hr) {
1454
+ grid-template-columns: auto 1fr auto;
1455
+ }
1456
+
1457
+ hr {
1458
+ background-color: transparent;
1459
+ border-block-end: var(--_border-width) var(--_border-style)
1460
+ var(--border-color);
1461
+ block-size: 2px;
1462
+ display: block;
1463
+ }
1464
+
1465
+ .term {
1466
+ inline-size: max-content;
1467
+
1468
+ &::after {
1469
+ display: inline-block;
1470
+ }
1471
+ }
1472
+ .description {
1473
+ color: var(--text-color-2);
1474
+ text-align: end;
1475
+ }
1476
+ }
1477
+ }
1478
+ }
1479
+ }
1480
+
1481
+ @layer components.root {
1482
+ :where(hr) {
1483
+ background-color: var(--border-color);
1484
+ block-size: var(--border-size-1);
1485
+ margin-block: var(--size-fluid-3);
1486
+ }
1487
+ }
1488
+
1489
+ @layer components.root {
1490
+ :where(.link) {
1491
+ color: var(--primary);
1492
+ cursor: pointer;
1493
+ font-weight: 700;
1494
+ text-decoration: underline;
1495
+ text-decoration-color: var(--primary);
1496
+ text-underline-offset: 2px;
1497
+
1498
+ &[href] {
1499
+ &:hover,
1500
+ &:focus-visible {
1501
+ color: var(--primary-light);
1502
+ }
1503
+ }
1504
+
1505
+ @supports (-moz-appearance: none) {
1506
+ text-underline-offset: 2px;
1507
+ }
1508
+ }
1509
+ }
1510
+
1511
+ @layer components.root {
1512
+ :where(table) {
1513
+ border-collapse: collapse;
1514
+ display: block;
1515
+ margin: var(--size-3) 0;
1516
+ max-inline-size: 100%;
1517
+ position: relative;
1518
+
1519
+ /* Rows */
1520
+ tr {
1521
+ background-color: var(--surface-default);
1522
+ border-top: 1px solid var(--border-color);
1523
+
1524
+ &:hover {
1525
+ background-color: oklch(from var(--surface-filled) l c h / 75%);
1526
+ }
1527
+ }
1528
+
1529
+ /* Cells */
1530
+ th,
1531
+ td {
1532
+ border: 1px solid var(--border-color);
1533
+ padding: var(--size-1) var(--size-2);
1534
+ }
1535
+
1536
+ th {
1537
+ background-color: var(--surface-filled);
1538
+ color: var(--text-color-1);
1539
+ font-size: var(--font-size-sm, 0.75rem);
1540
+ font-weight: 600;
1541
+ text-align: start;
1542
+ }
1543
+
1544
+ td {
1545
+ font-size: var(--font-size-sm, 0.75rem);
1546
+ }
1547
+
1548
+ /* Caption */
1549
+ caption {
1550
+ caption-side: bottom;
1551
+ color: var(--text-color-2);
1552
+ font-size: var(--font-size-sm, 0.75rem);
1553
+ padding: var(--size-2) 0;
1554
+ text-align: start;
1555
+ }
1556
+
1557
+ /* Header */
1558
+ thead {
1559
+ position: sticky;
1560
+ top: 0;
1561
+ z-index: 1;
1562
+ }
1563
+
1564
+ /* Footer */
1565
+ tfoot {
1566
+ border-top: 2px solid var(--border-color);
1567
+
1568
+ tr {
1569
+ background-color: var(--surface-filled);
1570
+ }
1571
+
1572
+ td {
1573
+ color: var(--text-color-1);
1574
+ font-weight: 600;
1575
+ }
1576
+ }
1577
+
1578
+ /* Column group */
1579
+ colgroup col {
1580
+ border: none;
1581
+ }
1582
+
1583
+ @container (width < 60ch) {
1584
+ th,
1585
+ td {
1586
+ padding: var(--size-1) 0.875rem;
1587
+ }
1588
+ }
1589
+
1590
+ /* Dense */
1591
+ &.dense {
1592
+ th,
1593
+ td {
1594
+ padding: var(--size-1) var(--size-2);
1595
+ }
1596
+
1597
+ caption {
1598
+ padding: var(--size-1) 0;
1599
+ }
1600
+
1601
+ @container (width < 60ch) {
1602
+ th,
1603
+ td {
1604
+ padding: var(--size-1) var(--size-2);
1605
+ }
1606
+ }
1607
+ }
1608
+ }
1609
+ }
1610
+
1611
+ @layer components.root {
1612
+ :where(progress) {
1613
+ --_accent-color: var(--primary);
1614
+ --_bg-color: var(--surface-tonal);
1615
+
1616
+ appearance: none;
1617
+ background-color: var(--_bg-color);
1618
+ border-radius: var(--border-radius, 0.25rem);
1619
+ border: 0;
1620
+ display: inline-block;
1621
+ block-size: var(--size-1);
1622
+ overflow: hidden;
1623
+ position: relative;
1624
+ vertical-align: baseline;
1625
+ inline-size: 100%;
1626
+
1627
+ &::-webkit-progress-bar {
1628
+ border-radius: var(--border-radius, 0.25rem);
1629
+ background: none;
1630
+ }
1631
+
1632
+ &[value]::-webkit-progress-value {
1633
+ background-color: var(--_accent-color);
1634
+
1635
+ @media (prefers-reduced-motion: no-preference) {
1636
+ transition: inline-size 0.2s
1637
+ var(--ease-out-4, cubic-bezier(0, 0, 0.1, 1));
1638
+ }
1639
+ }
1640
+
1641
+ &::-moz-progress-bar {
1642
+ background-color: var(--_accent-color);
1643
+ }
1644
+ }
1645
+
1646
+ @media (prefers-reduced-motion: no-preference) {
1647
+ progress:indeterminate {
1648
+ background-color: var(--_bg-color);
1649
+
1650
+ &::after {
1651
+ animation: indeterminate 2s linear infinite;
1652
+ background-color: var(--_accent-color);
1653
+ content: "";
1654
+ inset: 0 auto 0 0;
1655
+ position: absolute;
1656
+ will-change: inset-inline-start, inset-inline-end;
1657
+ }
1658
+
1659
+ &[value]::-webkit-progress-value {
1660
+ background-color: transparent;
1661
+ }
1662
+
1663
+ &::-moz-progress-bar {
1664
+ background-color: transparent;
1665
+ }
1666
+ }
1667
+
1668
+ [dir="rtl"] {
1669
+ :where(progress):indeterminate {
1670
+ animation-direction: reverse;
1671
+
1672
+ &::after {
1673
+ animation-direction: reverse;
1674
+ }
1675
+ }
1676
+ }
1677
+ }
1678
+
1679
+ @keyframes indeterminate {
1680
+ 0% {
1681
+ left: -200%;
1682
+ right: 100%;
1683
+ }
1684
+ 60% {
1685
+ left: 107%;
1686
+ right: -8%;
1687
+ }
1688
+ 100% {
1689
+ left: 107%;
1690
+ right: -8%;
1691
+ }
1692
+ }
1693
+ }
1694
+
1695
+ @layer components.root {
1696
+ [aria-busy="true"]:not(
1697
+ input,
1698
+ select,
1699
+ textarea,
1700
+ html,
1701
+ progress,
1702
+ [aria-describedby]
1703
+ ) {
1704
+ position: relative;
1705
+
1706
+ &::before {
1707
+ animation: spin 0.7s linear infinite;
1708
+ border-color: transparent currentColor currentColor;
1709
+ border-radius: 50%;
1710
+ border-style: solid;
1711
+ border-width: 3px;
1712
+ content: "";
1713
+ display: inline-block;
1714
+ block-size: 1em;
1715
+ opacity: 0.5;
1716
+ vertical-align: -0.14em;
1717
+ inline-size: 1em;
1718
+ }
1719
+
1720
+ &:not(button.button):not(:empty) {
1721
+ &::before {
1722
+ margin-inline-end: 0.5em;
1723
+ }
1724
+ }
1725
+ }
1726
+
1727
+ @keyframes spin {
1728
+ to {
1729
+ transform: rotate(1turn);
1730
+ }
1731
+ }
1732
+ }
1733
+
1734
+ @layer components.root {
1735
+ label:where(.checkbox, .radio) {
1736
+ align-items: center;
1737
+ color: var(--text-color-1);
1738
+ cursor: pointer;
1739
+ display: inline-grid;
1740
+ gap: 0 var(--size-2);
1741
+ grid-auto-columns: auto;
1742
+ grid-auto-flow: column;
1743
+ inline-size: fit-content;
1744
+ line-height: 1.5;
1745
+ transform: translateZ(0);
1746
+ user-select: none;
1747
+
1748
+ /* Disabled */
1749
+ &:has([disabled]) {
1750
+ cursor: not-allowed;
1751
+ opacity: 0.64;
1752
+ user-select: none;
1753
+
1754
+ input {
1755
+ cursor: not-allowed;
1756
+ }
1757
+ }
1758
+
1759
+ /* Required dot */
1760
+ &:has([required]:not([type="checkbox"]:checked)) {
1761
+ .label:after {
1762
+ color: var(--red);
1763
+ content: "*";
1764
+ inset: 0 -0.25ex auto auto;
1765
+ position: absolute;
1766
+ }
1767
+ }
1768
+
1769
+ /* Label */
1770
+ .label {
1771
+ grid-column: 2;
1772
+ grid-row: 1;
1773
+ position: relative;
1774
+ padding-inline: 0 1ex;
1775
+ }
1776
+
1777
+ /* Supporting text */
1778
+ .supporting-text {
1779
+ color: var(--text-color-2);
1780
+ font-size: var(--font-size-xs);
1781
+ grid-column: 2;
1782
+ grid-row: 2;
1783
+ line-height: 1.5;
1784
+ z-index: 1;
1785
+ }
1786
+
1787
+ /* Stacked layout */
1788
+ &.stack {
1789
+ justify-items: center;
1790
+ grid-auto-columns: unset;
1791
+
1792
+ .label {
1793
+ grid-column: 1/-1;
1794
+ grid-row: 2;
1795
+ margin-block-start: var(--size-1);
1796
+ padding-inline: 1ex;
1797
+
1798
+ /* Required dot */
1799
+ &::after {
1800
+ inset: 0 -0.25ex auto auto;
1801
+ }
1802
+ }
1803
+
1804
+ .supporting-text {
1805
+ grid-column: 1/-1;
1806
+ grid-row: 3;
1807
+ }
1808
+ }
1809
+
1810
+ /* Input */
1811
+ input {
1812
+ aspect-ratio: 1;
1813
+ block-size: 1.125rem;
1814
+ cursor: pointer;
1815
+ inline-size: 1.125rem;
1816
+
1817
+ &::before {
1818
+ --highlight-size: 175%;
1819
+ }
1820
+ }
1821
+
1822
+ /* Sizes */
1823
+ &.small {
1824
+ input {
1825
+ block-size: var(--size-3);
1826
+ inline-size: var(--size-3);
1827
+ }
1828
+ }
1829
+
1830
+ &.large {
1831
+ input {
1832
+ block-size: var(--size-4);
1833
+ inline-size: var(--size-4);
1834
+ }
1835
+ }
1836
+
1837
+ /* Validation */
1838
+ &.error {
1839
+ input[type="checkbox"] {
1840
+ accent-color: var(--color-9);
1841
+
1842
+ & ~ :where(.label, .supporting-text) {
1843
+ color: var(--color-9);
1844
+ }
1845
+ }
1846
+ }
1847
+
1848
+ /* Touch devices */
1849
+ @media (pointer: coarse) {
1850
+ input {
1851
+ block-size: var(--size-4);
1852
+ inline-size: var(--size-4);
1853
+ }
1854
+ }
1855
+ }
1856
+ }
1857
+
1858
+ @layer components.root {
1859
+ :where(.switch) {
1860
+ --_accent-color: var(--primary);
1861
+ --_accent-contrast: var(--primary-contrast);
1862
+
1863
+ --_dot-bg-color: light-dark(var(--gray-11), var(--gray-14));
1864
+ --_dot-inset: var(--size-1) auto auto var(--size-1);
1865
+ --_dot-outline-size: 0;
1866
+ --_dot-size: var(--size-3);
1867
+
1868
+ --_track-bg-color: light-dark(var(--gray-3), var(--gray-8));
1869
+ --_track-height: var(--size-5);
1870
+ --_track-width: var(--size-8);
1871
+ --_transition-tf: var(--ease-4);
1872
+ --_transition-time: 0.2s;
1873
+
1874
+ align-items: center;
1875
+ color: var(--text-color-1);
1876
+ display: inline-grid;
1877
+ gap: 0 var(--size-2);
1878
+ grid-auto-columns: auto;
1879
+ grid-auto-flow: column;
1880
+ inline-size: fit-content;
1881
+
1882
+ input[type="checkbox"][role="switch"] {
1883
+ appearance: none;
1884
+ block-size: var(--_track-height);
1885
+ cursor: pointer;
1886
+ inline-size: var(--_track-width);
1887
+ margin: 0;
1888
+ position: relative;
1889
+
1890
+ /* Track */
1891
+ &::before {
1892
+ background-color: var(--_track-bg-color);
1893
+ block-size: var(--_track-height);
1894
+ border: 1px solid var(--_dot-bg-color);
1895
+ border-radius: 100vmax;
1896
+ content: "";
1897
+ inline-size: var(--_track-width);
1898
+ inset: 0;
1899
+ position: absolute;
1900
+ }
1901
+
1902
+ &:focus-visible {
1903
+ outline-offset: 2px;
1904
+ outline: 2px solid currentColor;
1905
+ }
1906
+
1907
+ /* Dot */
1908
+ &::after {
1909
+ background-color: var(--_dot-bg-color);
1910
+ block-size: var(--_dot-size);
1911
+ border-radius: 100vmax;
1912
+ content: "";
1913
+ inline-size: var(--_dot-size);
1914
+ inset: var(--_dot-inset);
1915
+ outline-offset: -1px;
1916
+ outline: var(--_dot-outline-size) solid var(--_dot-bg-color);
1917
+ position: absolute;
1918
+ }
1919
+
1920
+ /* Checked */
1921
+ &:checked {
1922
+ &::before {
1923
+ background-color: var(--_accent-color);
1924
+ border-color: var(--_accent-color);
1925
+ transition: background-color var(--_transition-time)
1926
+ var(--_transition-tf),
1927
+ border-color var(--_transition-time) var(--_transition-tf);
1928
+ }
1929
+
1930
+ /* Dot */
1931
+ &::after {
1932
+ --_dot-bg-color: var(--_accent-contrast);
1933
+ --_dot-outline-size: calc(var(--size-1) - 1px);
1934
+
1935
+ inset-inline-start: calc(
1936
+ var(--_track-width) - var(--_dot-size) - var(--size-1)
1937
+ );
1938
+ }
1939
+ }
1940
+
1941
+ /* Animation */
1942
+ @media (prefers-reduced-motion: no-preference) {
1943
+ /* Track */
1944
+ &::before {
1945
+ transition: background-color var(--_transition-time)
1946
+ var(--_transition-tf),
1947
+ border-color var(--_transition-time) var(--_transition-tf);
1948
+ }
1949
+
1950
+ /* Dot */
1951
+ &::after {
1952
+ transition: all var(--_transition-time) var(--_transition-tf);
1953
+ }
1954
+
1955
+ &:active:after {
1956
+ --_dot-outline-size: calc(var(--size-1) + 1px);
1957
+ }
1958
+
1959
+ &:checked {
1960
+ &:active:after {
1961
+ --_dot-outline-size: calc(var(--size-1) + 1px);
1962
+ }
1963
+ }
1964
+ }
1965
+ }
1966
+
1967
+ /* Required dot */
1968
+ &:has([required]:not(:checked)) {
1969
+ .label:after {
1970
+ color: var(--red);
1971
+ content: "*";
1972
+ inset: 0 -0.25ex auto auto;
1973
+ position: absolute;
1974
+ }
1975
+ }
1976
+
1977
+ /* Disabled */
1978
+ &:has([disabled]) {
1979
+ cursor: not-allowed;
1980
+ opacity: 0.64;
1981
+ user-select: none;
1982
+
1983
+ input {
1984
+ cursor: not-allowed;
1985
+ }
1986
+ }
1987
+
1988
+ /* Label */
1989
+ .label {
1990
+ grid-column: 2;
1991
+ grid-row: 1;
1992
+ min-width: 0;
1993
+ padding-inline: 0 1ex;
1994
+ position: relative;
1995
+ user-select: none;
1996
+ }
1997
+
1998
+ /* Supporting text */
1999
+ .supporting-text {
2000
+ color: var(--text-color-2);
2001
+ font-size: var(--font-size-xs);
2002
+ grid-column: 2;
2003
+ grid-row: 2;
2004
+ line-height: 1.5;
2005
+ z-index: 1;
2006
+ }
2007
+
2008
+ /* Size */
2009
+ &.small {
2010
+ --_dot-size: 0.75rem;
2011
+ --_track-height: var(--size-4);
2012
+ --_track-width: 2.5rem;
2013
+ }
2014
+
2015
+ /* Stacked layout */
2016
+ &.stack {
2017
+ justify-items: center;
2018
+ grid-auto-columns: unset;
2019
+
2020
+ .label {
2021
+ grid-column: 1/-1;
2022
+ grid-row: 2;
2023
+ margin-block-start: var(--size-1);
2024
+ padding-inline: 1ex;
2025
+ }
2026
+
2027
+ .supporting-text {
2028
+ grid-column: 1/-1;
2029
+ grid-row: 3;
2030
+ }
2031
+ }
2032
+
2033
+ /* Validation */
2034
+ &.error {
2035
+ input {
2036
+ outline: 2px solid var(--color-9);
2037
+ border-radius: var(--radius-round);
2038
+ }
2039
+
2040
+ .label,
2041
+ .supporting-text {
2042
+ color: var(--color-9);
2043
+ }
2044
+ }
2045
+ }
2046
+ }
2047
+
2048
+ @layer components.root {
2049
+ :where(.range > input[type="range"]) {
2050
+ --thumb-bg: var(--primary);
2051
+ --thumb-highlight-color: oklch(from var(--primary) 70% 100% h / 20%);
2052
+ --thumb-highlight-size: 0px;
2053
+ --thumb-offset: -1ex;
2054
+ --thumb-size: 3ex;
2055
+ --track-color: var(--field-border-color);
2056
+ --track-fill: 0%;
2057
+ --track-height: 1ex;
2058
+
2059
+ appearance: none;
2060
+ background: transparent;
2061
+ display: block;
2062
+ inline-size: 100%;
2063
+ margin: 1ex 0 3ex;
2064
+ outline-offset: 1ex;
2065
+
2066
+ @media (hover: none) {
2067
+ --thumb-offset: -14px;
2068
+ --thumb-size: 30px;
2069
+ }
2070
+
2071
+ /* Track */
2072
+ &::-webkit-slider-runnable-track {
2073
+ appearance: none;
2074
+ background: linear-gradient(
2075
+ to right,
2076
+ transparent var(--track-fill),
2077
+ var(--track-color) 0%
2078
+ ),
2079
+ var(--primary);
2080
+ block-size: var(--track-height);
2081
+ border-radius: 5ex;
2082
+ box-shadow: var(--inner-shadow-1);
2083
+ }
2084
+
2085
+ &::-moz-range-track {
2086
+ appearance: none;
2087
+ background: linear-gradient(
2088
+ to right,
2089
+ transparent var(--track-fill),
2090
+ var(--track-color) 0%
2091
+ ),
2092
+ var(--primary);
2093
+ block-size: var(--track-height);
2094
+ border-radius: 5ex;
2095
+ box-shadow: var(--inner-shadow-2);
2096
+ }
2097
+
2098
+ /* Ring */
2099
+ &::-webkit-slider-thumb {
2100
+ appearance: none;
2101
+ background: var(--thumb-bg);
2102
+ block-size: var(--thumb-size);
2103
+ border-radius: 50%;
2104
+ border: 3px solid var(--surface-default);
2105
+ box-shadow: 0 0 0 var(--thumb-highlight-size) var(--thumb-highlight-color);
2106
+ cursor: ew-resize;
2107
+ inline-size: var(--thumb-size);
2108
+ margin-block-start: var(--thumb-offset);
2109
+
2110
+ @media (prefers-reduced-motion: no-preference) {
2111
+ transition: box-shadow 0.1s ease;
2112
+ }
2113
+
2114
+ .fieldset-item:focus-within & {
2115
+ border-color: var(--gray-14);
2116
+ }
2117
+ }
2118
+
2119
+ &::-moz-range-thumb {
2120
+ appearance: none;
2121
+ background: var(--thumb-bg);
2122
+ block-size: var(--thumb-size);
2123
+ border-radius: 50%;
2124
+ border: 3px solid var(--primary);
2125
+ box-shadow: 0 0 0 var(--thumb-highlight-size) var(--thumb-highlight-color);
2126
+ cursor: ew-resize;
2127
+ inline-size: var(--thumb-size);
2128
+ margin-block-start: var(--thumb-offset);
2129
+
2130
+ @media (prefers-reduced-motion: no-preference) {
2131
+ transition: box-shadow 0.1s ease;
2132
+ }
2133
+
2134
+ .fieldset-item:focus-within & {
2135
+ border-color: var(--gray-14);
2136
+ }
2137
+ }
2138
+
2139
+ /* Element state */
2140
+ &:not([disabled]) {
2141
+ &:hover {
2142
+ --thumb-highlight-size: var(--size-1);
2143
+ }
2144
+
2145
+ &:active {
2146
+ --thumb-highlight-size: var(--size-2);
2147
+ --track-color: light-dark(
2148
+ oklch(from var(--field-border-color) calc(l * 0.9) c h),
2149
+ oklch(from var(--field-border-color) calc(l * 1.1) c h)
2150
+ );
2151
+ }
2152
+ }
2153
+
2154
+ &[disabled] {
2155
+ --thumb-bg: oklch(from var(--text-color-1) l c h / 50%);
2156
+ --track-color: var(--field-border-color);
2157
+
2158
+ cursor: not-allowed;
2159
+
2160
+ &::-webkit-slider-thumb {
2161
+ cursor: not-allowed;
2162
+ }
2163
+ &::-moz-range-thumb {
2164
+ cursor: not-allowed;
2165
+ }
2166
+ }
2167
+ }
2168
+ }
2169
+
2170
+ @layer components.root {
2171
+ /* Base typography */
2172
+ :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
2173
+ color: var(--text-color-1);
2174
+ font-weight: 700;
2175
+ text-wrap: pretty;
2176
+ }
2177
+
2178
+ :where(h1, .h1) {
2179
+ font-size: var(--font-size-h1, var(--font-size-7));
2180
+ letter-spacing: -0.02em;
2181
+ line-height: 1.15;
2182
+ }
2183
+
2184
+ :where(h2, .h2) {
2185
+ font-size: var(--font-size-h2, var(--font-size-5, 2rem));
2186
+ letter-spacing: -0.02em;
2187
+ line-height: 1.2;
2188
+ }
2189
+
2190
+ :where(h3, .h3) {
2191
+ font-size: var(--font-size-h3, var(--font-size-4, 1.5rem));
2192
+ letter-spacing: -0.01em;
2193
+ line-height: 1.167;
2194
+ }
2195
+
2196
+ :where(h4, .h4) {
2197
+ font-size: var(--font-size-h4, var(--font-size-3, 1.25rem));
2198
+ letter-spacing: -0.01em;
2199
+ line-height: 1.235;
2200
+ }
2201
+
2202
+ :where(h5, .h5) {
2203
+ font-size: var(--font-size-h5, var(--font-size-2, 1.1rem));
2204
+ line-height: 1.334;
2205
+ }
2206
+
2207
+ :where(h6, .h6) {
2208
+ font-size: var(--font-size-h6, var(--font-size-1, 1rem));
2209
+ line-height: 1;
2210
+ }
2211
+
2212
+ :where(hgroup) {
2213
+ & > :where(p, .p) {
2214
+ margin: 0;
2215
+ }
2216
+
2217
+ & > :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
2218
+ margin-block-end: 0.4em;
2219
+ }
2220
+
2221
+ /* The second p element */
2222
+ & > :where(p, .p):last-of-type:last-child:not(:first-child) {
2223
+ color: oklch(from currentColor l c h / 75%);
2224
+ font-size: var(--font-size-lg);
2225
+ line-height: 1.6;
2226
+ }
2227
+ }
2228
+
2229
+ /** Overline */
2230
+ :where(.overline, hgroup > :where(p, .p):first-of-type:first-child) {
2231
+ color: light-dark(
2232
+ oklch(from var(--text-color-2) calc(l * 1.25) c h),
2233
+ oklch(from var(--text-color-2) calc(l * 0.75) c h)
2234
+ );
2235
+ font-size: var(--font-size-xs);
2236
+ font-weight: 500;
2237
+ letter-spacing: 0.06em;
2238
+ line-height: 2.5;
2239
+ text-transform: uppercase;
2240
+ }
2241
+
2242
+ :where(p, .p) {
2243
+ text-wrap: pretty;
2244
+
2245
+ &.small {
2246
+ font-size: var(--font-size-md);
2247
+ }
2248
+ &.large {
2249
+ font-size: var(--font-size-lg);
2250
+ }
2251
+ }
2252
+
2253
+ /* Inline text elements */
2254
+ :where(ins, u, abbr, dfn) {
2255
+ text-decoration: underline;
2256
+ text-underline-offset: 1px;
2257
+
2258
+ @supports (-moz-appearance: none) {
2259
+ text-underline-offset: 2px;
2260
+ }
2261
+ }
2262
+
2263
+ :where(abbr, dfn) {
2264
+ font-style: normal;
2265
+ text-decoration: var(--color-9) underline dotted;
2266
+
2267
+ &[title] {
2268
+ cursor: help;
2269
+ text-underline-offset: 1px;
2270
+ }
2271
+
2272
+ @supports (-moz-appearance: none) {
2273
+ text-underline-offset: 2px;
2274
+ }
2275
+ }
2276
+
2277
+ :where(sup) {
2278
+ font-size: 0.5em;
2279
+ }
2280
+
2281
+ :where(del, ins) {
2282
+ color: var(--color-9);
2283
+ }
2284
+
2285
+ :where(small) {
2286
+ font-size: max(0.5em, var(--font-size-0, 0.75rem));
2287
+ max-inline-size: var(--size-content-1);
2288
+ }
2289
+
2290
+ :where(cite) {
2291
+ font-style: italic;
2292
+ }
2293
+
2294
+ /* Blockquote */
2295
+ :where(blockquote) {
2296
+ border-inline-start-width: var(--border-size-3);
2297
+ display: grid;
2298
+ gap: var(--size-3);
2299
+ padding-block: var(--size-3);
2300
+ padding-inline: var(--size-4);
2301
+
2302
+ :first-child {
2303
+ margin-block-start: 0;
2304
+ }
2305
+
2306
+ :last-child {
2307
+ margin-block-end: 0;
2308
+ }
2309
+
2310
+ footer {
2311
+ color: var(--text-color-2);
2312
+ }
2313
+ }
2314
+
2315
+ /* Code */
2316
+ :where(pre) {
2317
+ border-radius: 0.375rem;
2318
+ direction: ltr;
2319
+ font-size: 0.875rem;
2320
+ line-height: 1.7142857;
2321
+ margin-block: 1.7142857em;
2322
+ max-inline-size: max-content;
2323
+ min-inline-size: 0;
2324
+ padding-block: 0.8571429em;
2325
+ padding-inline: 1.1428571em;
2326
+ white-space: pre;
2327
+ writing-mode: lr;
2328
+ }
2329
+
2330
+ :where(code, kbd, samp, pre) {
2331
+ font-family: var(--font-mono);
2332
+ }
2333
+
2334
+ :where(code) {
2335
+ background-color: oklch(00 0 0 /18%);
2336
+ border-radius: var(--border-size-3);
2337
+ font-size: 0.9em;
2338
+ padding: 0.2ex 0.5ex;
2339
+ }
2340
+
2341
+ :where(kbd, var) {
2342
+ background-color: var(--text-color-2);
2343
+ border-color: var(--text-color-2);
2344
+ border-radius: var(--border-radius, var(--radius-2));
2345
+ border-width: var(--border-size-1);
2346
+ color: var(--text-color-2-contrast);
2347
+ padding: calc(var(--size-1) / 2) var(--size-1);
2348
+ }
2349
+
2350
+ :where(:not(pre) code, kbd) {
2351
+ word-break: break-word;
2352
+ }
2353
+
2354
+ :where(:not(pre) code) {
2355
+ border-radius: var(--border-radius, var(--radius-2));
2356
+ padding: var(--size-1) var(--size-2);
2357
+ writing-mode: lr;
2358
+ }
2359
+
2360
+ :where(mark) {
2361
+ border-radius: var(--border-radius, 0);
2362
+ box-decoration-break: clone;
2363
+ padding: calc(var(--size-1) / 2) var(--size-1);
2364
+ vertical-align: baseline;
2365
+ }
2366
+
2367
+ /* Misc */
2368
+ :where(dt) {
2369
+ font-weight: 700;
2370
+ }
2371
+
2372
+ :where(figure) {
2373
+ & > :where(figcaption) {
2374
+ font-size: var(--font-size-1, 1rem);
2375
+ text-wrap: balance;
2376
+ }
2377
+ }
2378
+ }
2379
+
2380
+ /*** Extended components (has dependencies) */
2381
+
2382
+ @layer components.extended {
2383
+ :where([role="group"].button-group) {
2384
+ --_border-radius: var(--button-border-radius);
2385
+
2386
+ border-radius: var(--_border-radius);
2387
+ display: inline-flex;
2388
+ min-width: max-content;
2389
+
2390
+ button {
2391
+ border-radius: 0;
2392
+
2393
+ svg {
2394
+ max-inline-size: 0.7lh;
2395
+ }
2396
+
2397
+ &:focus-visible {
2398
+ outline-offset: -4px;
2399
+ }
2400
+
2401
+ & + & {
2402
+ border-inline-width: 1px;
2403
+ margin-inline-start: -1px;
2404
+ }
2405
+
2406
+ &:first-of-type {
2407
+ border-bottom-left-radius: var(--_border-radius);
2408
+ border-top-left-radius: var(--_border-radius);
2409
+ }
2410
+ &:last-of-type {
2411
+ border-bottom-right-radius: var(--_border-radius);
2412
+ border-top-right-radius: var(--_border-radius);
2413
+ }
2414
+
2415
+ /* Variants */
2416
+ &:where(.tonal, .filled) {
2417
+ & + button {
2418
+ border-inline-start-color: var(--color-7);
2419
+ }
2420
+
2421
+ & + &[disabled] {
2422
+ border-inline-start-color: color-mix(
2423
+ in oklch,
2424
+ var(--border-color) 90%,
2425
+ white
2426
+ );
2427
+ }
2428
+ }
2429
+ }
2430
+ }
2431
+ }
2432
+
2433
+ @layer components.extended {
2434
+ :where(details) {
2435
+ --_accordion-transition-time: 0.2s;
2436
+ --_bg-color: transparent;
2437
+ --_margin-inline: var(--size-1);
2438
+ --_shadow: none;
2439
+
2440
+ background-color: var(--_bg-color);
2441
+ box-shadow: var(--_shadow);
2442
+ border-radius: var(--border-radius, 4px);
2443
+ display: block;
2444
+ margin-inline: var(--_margin-inline);
2445
+ transition: all var(--_accordion-transition-time) ease-out;
2446
+
2447
+ /* Accordion animation */
2448
+ /* https://nerdy.dev/open-and-close-transitions-for-the-details-element */
2449
+ @media (prefers-reduced-motion: no-preference) {
2450
+ interpolate-size: allow-keywords;
2451
+ }
2452
+
2453
+ &::details-content {
2454
+ block-size: 0;
2455
+ opacity: 0;
2456
+ overflow-y: clip;
2457
+ transition: content-visibility var(--_accordion-transition-time)
2458
+ allow-discrete,
2459
+ opacity var(--_accordion-transition-time),
2460
+ block-size var(--_accordion-transition-time);
2461
+ }
2462
+
2463
+ &[open]::details-content {
2464
+ block-size: auto;
2465
+ opacity: 1;
2466
+ }
2467
+ /***/
2468
+
2469
+ & > summary {
2470
+ background-color: inherit;
2471
+ cursor: pointer;
2472
+ font-weight: 700;
2473
+ padding-block: var(--size-3);
2474
+ user-select: none;
2475
+ }
2476
+
2477
+ /* Custom arrow */
2478
+ /* summary {
2479
+ align-items: center;
2480
+ background-color: inherit;
2481
+ cursor: pointer;
2482
+ display: flex;
2483
+ justify-content: space-between;
2484
+ list-style: none;
2485
+ padding-block: var(--size-3);
2486
+ user-select: none;
2487
+
2488
+ &::marker,
2489
+ &::-webkit-details-marker {
2490
+ display: none;
2491
+ }
2492
+
2493
+ svg {
2494
+ transition: rotate 0.2s ease-out;
2495
+ }
2496
+ }
2497
+
2498
+ &[open] > summary svg {
2499
+ rotate: 180deg;
2500
+ } */
2501
+
2502
+ & > .content {
2503
+ margin-block-start: 0;
2504
+ padding-block: var(--size-2) var(--size-3);
2505
+ }
2506
+
2507
+ & > .actions {
2508
+ display: flex;
2509
+ gap: var(--size-1);
2510
+ justify-content: end;
2511
+ margin-block-start: var(--size-3);
2512
+ padding-block-end: var(--size-1);
2513
+ padding-inline: var(--size-3) var(--size-1);
2514
+ }
2515
+
2516
+ /* Variants */
2517
+ &.card,
2518
+ &.text {
2519
+ --_bg-color: transparent;
2520
+ --_margin-inline: var(--size-1);
2521
+ }
2522
+
2523
+ &.elevated {
2524
+ --_bg-color: var(--surface-elevated);
2525
+ --_margin-inline: 0;
2526
+ --_shadow: var(--shadow-2);
2527
+ }
2528
+
2529
+ &.outlined {
2530
+ --_bg-color: var(--surface-default);
2531
+ --_margin-inline: 0;
2532
+ border: 1px solid var(--border-color);
2533
+ }
2534
+
2535
+ &.tonal {
2536
+ --_bg-color: var(--surface-tonal);
2537
+ --_margin-inline: 0;
2538
+ }
2539
+
2540
+ &:where(.elevated, .outlined, .tonal) > * {
2541
+ padding-inline: var(--size-3);
2542
+ }
2543
+ }
2544
+
2545
+ /* Accordion group */
2546
+ :where(.card:has(details)) {
2547
+ --_gutter-color: var(--border-color);
2548
+
2549
+ display: block;
2550
+
2551
+ & > .content {
2552
+ margin-block: 0;
2553
+ padding: 0;
2554
+ }
2555
+
2556
+ &.card,
2557
+ &.text {
2558
+ &:not(.tonal, .outlined, .elevated) {
2559
+ summary {
2560
+ padding-inline: 0;
2561
+ }
2562
+ }
2563
+ }
2564
+
2565
+ details {
2566
+ --_margin-inline: 0;
2567
+
2568
+ border: 0;
2569
+ box-shadow: none;
2570
+
2571
+ & > * {
2572
+ padding-inline: var(--size-3);
2573
+ }
2574
+
2575
+ /* Border between accordion items */
2576
+ & + & {
2577
+ summary {
2578
+ border-radius: 0;
2579
+ border-block-start: 1px solid var(--_gutter-color);
2580
+ }
2581
+ }
2582
+
2583
+ /* First item */
2584
+ &:first-of-type {
2585
+ border-start-start-radius: var(--border-radius, 0.25rem);
2586
+ border-start-end-radius: var(--border-radius, 0.25rem);
2587
+ summary {
2588
+ border-start-start-radius: var(--border-radius, 0.25rem);
2589
+ border-start-end-radius: var(--border-radius, 0.25rem);
2590
+ }
2591
+ }
2592
+
2593
+ /* Last item */
2594
+ &:last-of-type {
2595
+ border-end-start-radius: var(--border-radius, 0.25rem);
2596
+ border-end-end-radius: var(--border-radius, 0.25rem);
2597
+ summary {
2598
+ border-end-start-radius: var(--border-radius, 0.25rem);
2599
+ border-end-end-radius: var(--border-radius, 0.25rem);
2600
+ }
2601
+ }
2602
+ }
2603
+ }
2604
+ }
2605
+
2606
+ @layer components.extended {
2607
+ /*
2608
+ Lists meant to be used stand-alone or as part of Select elements
2609
+
2610
+ Intended use-case:
2611
+ - ul.list > li
2612
+ - .select > .list > option
2613
+ */
2614
+ :where(.list) {
2615
+ --_bg-color: light-dark(var(--gray-1), var(--gray-15));
2616
+ --_bg-color-hover: light-dark(var(--gray-2), var(--gray-14));
2617
+
2618
+ background-color: var(--_bg-color);
2619
+ list-style: none;
2620
+ padding: var(--size-2) 0;
2621
+
2622
+ @media (pointer: coarse) {
2623
+ &,
2624
+ * {
2625
+ user-select: none;
2626
+ }
2627
+ }
2628
+
2629
+ /* Borders on all list items */
2630
+ &.bordered {
2631
+ :where(li + li, option + option) {
2632
+ margin-block-start: var(--size-3);
2633
+ &::before {
2634
+ block-size: 1px;
2635
+ border-block-start: 1px solid var(--border-color);
2636
+ content: "";
2637
+ display: block;
2638
+ inline-size: 100%;
2639
+ inset: calc(-1 * var(--size-2)) 0 auto 0;
2640
+ position: absolute;
2641
+ visibility: visible; /* override select > option:before style */
2642
+ }
2643
+ }
2644
+ }
2645
+
2646
+ /* Dense - less gaps and spacing */
2647
+ &.dense {
2648
+ :where(li, option) {
2649
+ gap: var(--size-2);
2650
+ min-block-size: var(--size-7);
2651
+ padding: var(--size-1) var(--size-2);
2652
+
2653
+ &.border-top {
2654
+ margin-block-start: var(--size-2);
2655
+ &::before {
2656
+ inset: calc(-1 * var(--size-1)) 0 auto 0;
2657
+ }
2658
+ }
2659
+
2660
+ /* Clickable list item */
2661
+ &:has(> a, > button, > label) {
2662
+ min-block-size: auto;
2663
+ padding: 0;
2664
+ }
2665
+
2666
+ & > :where(a, button, label) {
2667
+ gap: var(--size-2);
2668
+ min-block-size: var(--size-7);
2669
+ padding: var(--size-1) var(--size-2);
2670
+ }
2671
+
2672
+ /* Checkbox / Radio */
2673
+ & > label {
2674
+ .end {
2675
+ padding-inline-end: 0.125rem;
2676
+ }
2677
+ }
2678
+
2679
+ /* Leading and trailing content */
2680
+ .start,
2681
+ .end {
2682
+ .avatar {
2683
+ max-inline-size: var(--size-6);
2684
+ }
2685
+
2686
+ .icon-button,
2687
+ svg {
2688
+ max-inline-size: var(--size-4);
2689
+ }
2690
+
2691
+ .checkbox,
2692
+ .radio {
2693
+ max-inline-size: var(--size-3);
2694
+ }
2695
+ }
2696
+ }
2697
+ }
2698
+
2699
+ /* Gutterless */
2700
+ &.gutterless {
2701
+ :where(li, option) {
2702
+ padding-inline: 0;
2703
+
2704
+ & > :where(a, button, label) {
2705
+ padding-inline: 0;
2706
+ }
2707
+ }
2708
+ }
2709
+
2710
+ /* List item */
2711
+ :where(li, option, [role="group"] > label) {
2712
+ align-items: center;
2713
+ background: var(--_bg-color) var(--ripple, none);
2714
+ display: flex;
2715
+ font-size: var(--font-size-sm);
2716
+ gap: var(--size-3);
2717
+ isolation: isolate;
2718
+ min-block-size: 40px;
2719
+ padding: var(--size-2) var(--size-3);
2720
+ position: relative;
2721
+
2722
+ &::before {
2723
+ display: none; /* removing checkmark from option */
2724
+ }
2725
+
2726
+ * {
2727
+ font-size: inherit;
2728
+ }
2729
+
2730
+ /* Clickable list item */
2731
+ &:has(> a, > button, > label) {
2732
+ background: transparent;
2733
+ display: block;
2734
+ min-block-size: auto;
2735
+ padding: 0;
2736
+ }
2737
+
2738
+ /* Select option */
2739
+ &:where(option) {
2740
+ align-items: center;
2741
+ background-color: var(--_bg-color);
2742
+ color: inherit;
2743
+ cursor: pointer;
2744
+ display: flex;
2745
+ gap: var(--size-3);
2746
+ inline-size: 100%;
2747
+ margin: 0;
2748
+ min-block-size: 40px;
2749
+ padding: var(--size-2) var(--size-3);
2750
+ text-align: start;
2751
+ text-decoration: none;
2752
+ z-index: 0;
2753
+
2754
+ &:hover {
2755
+ background-color: var(--_bg-color-hover);
2756
+ }
2757
+
2758
+ &:checked {
2759
+ background-color: oklch(from var(--primary) l c h / 30%);
2760
+ }
2761
+ }
2762
+
2763
+ & > a,
2764
+ & > button,
2765
+ & > label {
2766
+ align-items: center;
2767
+ background: var(--_bg-color) var(--ripple, none);
2768
+ color: inherit;
2769
+ cursor: pointer;
2770
+ display: flex;
2771
+ gap: var(--size-3);
2772
+ inline-size: 100%;
2773
+ margin: 0;
2774
+ min-block-size: 40px;
2775
+ outline-offset: -3px;
2776
+ padding: var(--size-2) var(--size-3);
2777
+ text-align: start;
2778
+ text-decoration: none;
2779
+ z-index: 0;
2780
+
2781
+ /*** Ripple effect */
2782
+ background-position: center;
2783
+ transition: background var(--button-ripple-duration);
2784
+ &:where(:not(:active):hover) {
2785
+ --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%)
2786
+ center/15000%;
2787
+ }
2788
+
2789
+ &:where(:hover:active) {
2790
+ background-size: var(--button-ripple-size);
2791
+ transition: background 0s;
2792
+ }
2793
+
2794
+ &:hover {
2795
+ background-color: var(--_bg-color-hover);
2796
+ }
2797
+
2798
+ /*** Remove ripple effect when trailing button is clicked */
2799
+ &:has(.end:hover) {
2800
+ &:where(:not(:active):hover) {
2801
+ --ripple: none;
2802
+ }
2803
+ }
2804
+ }
2805
+
2806
+ /* Checkbox / Radio / Switch */
2807
+ & > label {
2808
+ .end {
2809
+ padding-inline-end: var(--size-1);
2810
+ }
2811
+
2812
+ &:where(.checkbox, .radio) {
2813
+ inline-size: 100%;
2814
+ }
2815
+
2816
+ &.switch {
2817
+ --_dot-size: 0.75rem;
2818
+ --_track-height: var(--size-4);
2819
+ --_track-width: 2.5rem;
2820
+ }
2821
+ }
2822
+
2823
+ /* Video */
2824
+ &:has(video) {
2825
+ padding: 0.75rem var(--size-3) 0.75rem 0;
2826
+ }
2827
+
2828
+ /* Border between list items */
2829
+ &.border-top {
2830
+ margin-block-start: var(--size-3);
2831
+ &::before {
2832
+ block-size: 1px;
2833
+ border-block-start: 1px solid var(--border-color);
2834
+ content: "";
2835
+ display: block;
2836
+ inline-size: 100%;
2837
+ inset: calc(-1 * var(--size-2)) 0 auto 0;
2838
+ position: absolute;
2839
+ }
2840
+ }
2841
+
2842
+ /* Text */
2843
+ .text {
2844
+ flex: 1;
2845
+ line-height: 1.6;
2846
+
2847
+ :where(h1, h2, h3, h4, h5, h6, p, span) {
2848
+ color: inherit;
2849
+ font-weight: 400;
2850
+ }
2851
+
2852
+ p + p {
2853
+ font-size: var(--font-size-xs);
2854
+ }
2855
+ }
2856
+
2857
+ /* Leading content */
2858
+ .start {
2859
+ align-self: center;
2860
+ align-items: center;
2861
+ display: grid;
2862
+ z-index: 1;
2863
+
2864
+ &:has(svg) {
2865
+ max-inline-size: var(--size-5);
2866
+ }
2867
+
2868
+ svg {
2869
+ padding-block-start: 0.125rem;
2870
+ }
2871
+
2872
+ img {
2873
+ aspect-ratio: 1;
2874
+ inline-size: 56px;
2875
+ object-fit: cover;
2876
+ }
2877
+
2878
+ video {
2879
+ aspect-ratio: 16/9;
2880
+ block-size: 64px;
2881
+ object-fit: cover;
2882
+ }
2883
+ }
2884
+
2885
+ /* Trailing content */
2886
+ .end {
2887
+ align-items: center;
2888
+ display: flex;
2889
+ font-size: var(--font-size-xs);
2890
+ text-align: end;
2891
+ z-index: 1;
2892
+
2893
+ &:not(:has(a, button, input)) {
2894
+ pointer-events: none;
2895
+ }
2896
+
2897
+ kbd {
2898
+ background-color: transparent;
2899
+ border: 0;
2900
+ color: inherit;
2901
+ opacity: 0.6;
2902
+ }
2903
+
2904
+ svg {
2905
+ max-inline-size: var(--size-5);
2906
+ inline-size: 100%;
2907
+ }
2908
+ }
2909
+
2910
+ /* Inset */
2911
+ &.inset {
2912
+ .text {
2913
+ padding-inline-start: calc(var(--size-5) + var(--size-3));
2914
+ }
2915
+
2916
+ /* Safety measure so it won't look bad if there for some reason should exist a leading element inside. */
2917
+ .start {
2918
+ display: none;
2919
+ }
2920
+ }
2921
+ }
2922
+ }
2923
+ }
2924
+
2925
+ @layer components.extended {
2926
+ :where(.alert) {
2927
+ --_bg-color: var(--surface-tonal);
2928
+ --_border-color: var(--surface-tonal);
2929
+ --_color: var(--text-color-1);
2930
+
2931
+ &.outlined {
2932
+ --_bg-color: var(--surface-default);
2933
+ --_border-color: var(--border-color);
2934
+ --_color: var(--text-color-1);
2935
+ }
2936
+
2937
+ background-color: var(--_bg-color);
2938
+ border: 1px solid var(--_border-color);
2939
+ border-radius: var(--border-radius);
2940
+ color: var(--_color);
2941
+ padding: var(--size-3);
2942
+
2943
+ & > .content {
2944
+ display: grid;
2945
+ gap: var(--size-2);
2946
+ font-size: var(--font-size-sm);
2947
+
2948
+ h1,
2949
+ h2,
2950
+ h3,
2951
+ h4,
2952
+ h5,
2953
+ h6 {
2954
+ color: inherit;
2955
+ font-size: var(--font-size-md);
2956
+ font-weight: 600;
2957
+
2958
+ * {
2959
+ font-size: inherit;
2960
+ }
2961
+ }
2962
+ }
2963
+
2964
+ /* Colors */
2965
+ &.error,
2966
+ &.ok,
2967
+ &.warning {
2968
+ --_bg-color: var(--color-4);
2969
+ --_border-color: var(--color-9);
2970
+ --_color: var(--color-15);
2971
+
2972
+ &.outlined {
2973
+ --_bg-color: var(--surface-default);
2974
+ --_border-color: var(--color-9);
2975
+ --_color: light-dark(var(--color-15), var(--color-1));
2976
+ }
2977
+
2978
+ svg {
2979
+ margin-block-start: 0.15rem;
2980
+ stroke: var(--color-9);
2981
+ }
2982
+ }
2983
+
2984
+ /* Links
2985
+ * Can't make sure contrast will be acceptable (yet) so we use the current text color instead.
2986
+ */
2987
+ &:not(.outlined) {
2988
+ a[href] {
2989
+ color: inherit;
2990
+
2991
+ &:hover {
2992
+ color: var(--primary);
2993
+ }
2994
+ }
2995
+ }
2996
+
2997
+ /* Icon */
2998
+ &:has(svg) {
2999
+ display: grid;
3000
+ gap: var(--size-3);
3001
+ grid-template-columns: var(--size-4) 1fr;
3002
+
3003
+ svg {
3004
+ margin-block-start: 0.15rem;
3005
+ stroke: currentColor;
3006
+ }
3007
+ }
3008
+ }
3009
+ }
3010
+
3011
+ @layer components.extended {
3012
+ :where(dialog) {
3013
+ margin-block-start: 15%; /* vertical alignment */
3014
+ padding-block: 0;
3015
+ pointer-events: none;
3016
+
3017
+ &::backdrop {
3018
+ background-color: rgba(0, 0, 0, 0.5);
3019
+ backdrop-filter: blur(5px);
3020
+
3021
+ @media (prefers-reduced-motion: reduce) {
3022
+ backdrop-filter: none;
3023
+ }
3024
+ }
3025
+
3026
+ &:not([open]) {
3027
+ display: none;
3028
+ }
3029
+
3030
+ &[open] {
3031
+ pointer-events: all;
3032
+ }
3033
+
3034
+ .actions {
3035
+ justify-content: end;
3036
+ padding-inline: var(--size-3) var(--size-1);
3037
+ }
3038
+
3039
+ /* Animation */
3040
+ /* There's no close animation, intentionally */
3041
+ opacity: 0;
3042
+
3043
+ &[open] {
3044
+ opacity: 1;
3045
+ transition: display 0.2s allow-discrete,
3046
+ margin-block-start 0.3s var(--ease-1), overlay 0.2s allow-discrete,
3047
+ opacity 0.2s var(--ease-out-1);
3048
+
3049
+ @starting-style {
3050
+ opacity: 0;
3051
+ }
3052
+ }
3053
+
3054
+ @media (prefers-reduced-motion: no-preference) {
3055
+ margin-block-start: 17%;
3056
+ &[open] {
3057
+ margin-block-start: 15%;
3058
+
3059
+ @starting-style {
3060
+ margin-block-start: 17%;
3061
+ }
3062
+ }
3063
+ }
3064
+ }
3065
+
3066
+ :where(html:has(dialog[open])) {
3067
+ overflow: hidden;
3068
+ }
3069
+ }
3070
+
3071
+ @layer components.extended {
3072
+ :where(.snackbar) {
3073
+ align-items: center;
3074
+ /* Inverse surface-filled */
3075
+ background-color: light-dark(var(--gray-15), var(--gray-2));
3076
+ border-radius: var(--border-radius);
3077
+ box-shadow: var(--shadow-2);
3078
+ color: var(--text-color-1-contrast);
3079
+ display: flex;
3080
+ font-size: var(--font-size-sm);
3081
+ gap: var(--size-3);
3082
+ inset-block: auto var(--size-3);
3083
+ inset-inline: var(--size-3) auto;
3084
+ justify-content: space-between;
3085
+ min-inline-size: min(100%, 37ch);
3086
+ padding: var(--size-2) var(--size-3);
3087
+ position: fixed;
3088
+ inline-size: calc(100% - var(--size-6, 1.75rem));
3089
+ z-index: 100;
3090
+
3091
+ &::backdrop {
3092
+ display: none;
3093
+ }
3094
+
3095
+ * {
3096
+ word-break: break-word;
3097
+ }
3098
+
3099
+ /* Global positioning (in relation to the window) */
3100
+ /*** Default (end-start) */
3101
+ inset-block: auto var(--size-3);
3102
+ inset-inline: 50% 0;
3103
+ translate: -50% 0;
3104
+
3105
+ &.start-start,
3106
+ &.start-center,
3107
+ &.start-end {
3108
+ inset-block: var(--size-3) auto;
3109
+ }
3110
+
3111
+ /* TODO use @custom-media instead? */
3112
+ @container (width > 480px) {
3113
+ /* Default (end-start) */
3114
+ inset-block: auto var(--size-7, 2rem);
3115
+ inset-inline: var(--size-7, 2rem) auto;
3116
+ translate: revert;
3117
+ inline-size: fit-content;
3118
+
3119
+ &.end-start,
3120
+ &.end-end,
3121
+ &.start-start,
3122
+ &.start-end {
3123
+ translate: revert;
3124
+ }
3125
+
3126
+ &.start-start {
3127
+ inset-block: var(--size-7, 2rem) auto;
3128
+ inset-inline: var(--size-7, 2rem) auto;
3129
+ }
3130
+ &.start-center {
3131
+ inset-block: var(--size-7, 2rem) auto;
3132
+ inset-inline: 50% 0;
3133
+ translate: -50% 0;
3134
+ }
3135
+ &.start-end {
3136
+ inset-block: var(--size-7, 2rem) auto;
3137
+ inset-inline: auto var(--size-7, 2rem);
3138
+ }
3139
+ &.end-start {
3140
+ inset-block-end: var(--size-7, 2rem);
3141
+ inset-inline: var(--size-7, 2rem) auto;
3142
+ }
3143
+ &.end-center {
3144
+ inset-block: auto var(--size-7, 2rem);
3145
+ inset-inline: 50% 0;
3146
+ translate: -50% 0;
3147
+ }
3148
+ &.end-end {
3149
+ inset-block: auto var(--size-7, 2rem);
3150
+ inset-inline: auto var(--size-7, 2rem);
3151
+ }
3152
+ }
3153
+
3154
+ /* Absolute positioning */
3155
+ &.absolute {
3156
+ position: absolute;
3157
+ }
3158
+
3159
+ /* Actions */
3160
+ .actions {
3161
+ align-items: center;
3162
+ display: flex;
3163
+ flex-shrink: 0;
3164
+ gap: var(--size-3);
3165
+ padding-inline: 0;
3166
+
3167
+ button {
3168
+ /* Inverse hover and active backgrounds */
3169
+ &:where(:not([disabled])) {
3170
+ &:where(:not(:active):hover) {
3171
+ --_bg-color: light-dark(
3172
+ color-mix(in oklch, white 40%, black),
3173
+ color-mix(in oklch, white 85%, black)
3174
+ );
3175
+ }
3176
+
3177
+ &:where(:hover:active) {
3178
+ --_bg-color: light-dark(
3179
+ color-mix(in oklch, white 45%, black),
3180
+ color-mix(in oklch, white 80%, black)
3181
+ );
3182
+ }
3183
+ }
3184
+ }
3185
+
3186
+ button:not(:has(svg)) {
3187
+ border-radius: var(--border-radius);
3188
+ font-size: inherit;
3189
+ max-block-size: var(--size-6, 1.5rem);
3190
+ padding: 1ex;
3191
+ }
3192
+
3193
+ button:has(svg) {
3194
+ color: inherit;
3195
+ max-inline-size: var(--size-6, 1.75rem);
3196
+ margin: var(--size-00);
3197
+ padding: var(--size-1);
3198
+ }
3199
+ }
3200
+
3201
+ /* Animations */
3202
+ opacity: 0;
3203
+ transition: display 0.075s allow-discrete, overlay 0.075s allow-discrete,
3204
+ opacity 0.075s var(--ease-out-1);
3205
+
3206
+ &:popover-open,
3207
+ &:popover-open::backdrop,
3208
+ &.visible {
3209
+ opacity: 1;
3210
+ transition: display 0.25s allow-discrete, overlay 0.25s allow-discrete,
3211
+ opacity 0.25s var(--ease-out-1);
3212
+
3213
+ @starting-style {
3214
+ opacity: 0;
3215
+ }
3216
+ }
3217
+ }
3218
+ }
3219
+
3220
+ @layer components.extended {
3221
+ /* Common styling for checkbox, radio and switch groups */
3222
+ :where(fieldset.field-group) {
3223
+ border: 0;
3224
+ border-radius: 0;
3225
+ gap: 0;
3226
+ padding: 0;
3227
+ z-index: 1;
3228
+
3229
+ legend {
3230
+ color: var(--text-color-2);
3231
+ padding: 0 1ex 0 0;
3232
+ }
3233
+
3234
+ /* Disabled */
3235
+ &[disabled] {
3236
+ cursor: not-allowed;
3237
+ opacity: 0.64;
3238
+ user-select: none;
3239
+
3240
+ input {
3241
+ cursor: not-allowed;
3242
+ }
3243
+ }
3244
+
3245
+ /* Validation */
3246
+ &.error {
3247
+ legend,
3248
+ .supporting-text {
3249
+ color: var(--color-9);
3250
+ }
3251
+ }
3252
+
3253
+ /* Required */
3254
+ &:has([required]) {
3255
+ &:not(:has(input:where([type="radio"], [type="checkbox"]):checked)) {
3256
+ legend {
3257
+ position: relative;
3258
+
3259
+ &::after {
3260
+ color: var(--red);
3261
+ content: "*";
3262
+ inset: 0 -0.25ex auto auto;
3263
+ position: absolute;
3264
+ }
3265
+ }
3266
+ }
3267
+ }
3268
+ :where(.radio, .checkbox, .switch) .label:after {
3269
+ display: none;
3270
+ }
3271
+
3272
+ /* Supporting text */
3273
+ .supporting-text {
3274
+ color: var(--text-color-2);
3275
+ font-size: var(--font-size-xs);
3276
+ line-height: 1.5;
3277
+ z-index: 1;
3278
+ }
3279
+
3280
+ /* Fields */
3281
+ .fields {
3282
+ display: flex;
3283
+ flex-direction: column;
3284
+ gap: var(--size-2);
3285
+
3286
+ * ~ & {
3287
+ padding: var(--size-2) 0;
3288
+ }
3289
+ }
3290
+
3291
+ :last-child {
3292
+ padding-block-end: 0;
3293
+ }
3294
+
3295
+ /* Directions */
3296
+ &.row {
3297
+ .fields {
3298
+ flex-direction: row;
3299
+ }
3300
+ }
3301
+ }
3302
+ }
3303
+
3304
+ @layer components.extended {
3305
+ /*
3306
+ - Common styling for input, textarea and select
3307
+ - Form related styles such as: label, supporting text, error handling
3308
+ */
3309
+ :where(.field) {
3310
+ --_accent-color: var(--primary);
3311
+ --_bg-color: var(--surface-default);
3312
+ --_border-color: var(--field-border-color);
3313
+ --_field-padding-block: 0.75rem;
3314
+ --_field-padding-inline: var(--size-2);
3315
+ --_filled-border-color: var(--text-color-1);
3316
+ --_height: var(--field-size);
3317
+ --_label-color: var(--text-color-2);
3318
+ --_supporting-text-color: var(--text-color-2);
3319
+
3320
+ display: grid;
3321
+ position: relative;
3322
+
3323
+ /* Input/Select base */
3324
+ :where(& input, & textarea, & select) {
3325
+ background-color: var(--_bg-color);
3326
+ block-size: var(--_height);
3327
+ border-radius: var(--field-border-radius);
3328
+ border: var(--field-border-width) solid var(--_border-color);
3329
+ color: var(--text-color-1);
3330
+ font-family: var(--font-sans);
3331
+ font-size: var(--font-size-1);
3332
+ grid-column: 1/-1;
3333
+ grid-row: 2;
3334
+ inline-size: 100%;
3335
+ line-height: var(--font-lineheight-1);
3336
+ min-inline-size: 0;
3337
+ padding: var(--_field-padding-block) var(--_field-padding-inline);
3338
+
3339
+ @media (prefers-reduced-motion: no-preference) {
3340
+ transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
3341
+ padding-block 0.2s var(--ease-3);
3342
+ }
3343
+ }
3344
+
3345
+ /* Required/Invalid */
3346
+ &:has(
3347
+ :not(:placeholder-shown):invalid,
3348
+ :where(
3349
+ :placeholder-shown,
3350
+ option[value=""]:not(:checked),
3351
+ option:checked:not([value=""])
3352
+ ):required
3353
+ ) {
3354
+ .label:after {
3355
+ color: var(--red);
3356
+ content: "*";
3357
+ margin: -0.25em auto auto 0.25em;
3358
+ }
3359
+ }
3360
+
3361
+ /* File */
3362
+ &:has(input[type="file"]) {
3363
+ cursor: pointer;
3364
+
3365
+ input {
3366
+ align-self: flex-start;
3367
+ block-size: var(--_height);
3368
+ box-shadow: none;
3369
+ color: var(--text-color-1);
3370
+ cursor: inherit;
3371
+ max-inline-size: 100%;
3372
+ padding: 0;
3373
+ transition: font-size 0.2s var(--ease-3);
3374
+
3375
+ &::-webkit-file-upload-button,
3376
+ &::file-selector-button {
3377
+ background-color: var(--surface-tonal);
3378
+ border: none;
3379
+ block-size: calc(100% - var(--size-2) * 2);
3380
+ border-radius: var(--field-border-radius);
3381
+ cursor: pointer;
3382
+ margin-inline-end: 1ex;
3383
+ margin-block-start: var(--size-2);
3384
+ margin-inline-start: var(--size-2);
3385
+ }
3386
+ }
3387
+
3388
+ /* Variants */
3389
+ &.filled {
3390
+ input {
3391
+ &::-webkit-file-upload-button,
3392
+ &::file-selector-button {
3393
+ background-color: var(--surface-default);
3394
+ block-size: calc(100% - var(--size-2) * 2);
3395
+ border-radius: var(--field-border-radius);
3396
+ cursor: pointer;
3397
+ margin-block-start: var(--size-2);
3398
+ }
3399
+ }
3400
+ }
3401
+
3402
+ /* Sizes */
3403
+ &.small {
3404
+ input {
3405
+ font-size: var(--font-size-sm);
3406
+ &::-webkit-file-upload-button,
3407
+ &::file-selector-button {
3408
+ block-size: calc(100% - var(--size-2));
3409
+ margin-block-start: var(--size-1);
3410
+ }
3411
+ }
3412
+ }
3413
+ }
3414
+
3415
+ /* Autosuggest */
3416
+ &:has(input[list]) {
3417
+ .label {
3418
+ /* Make sure chevron is visible */
3419
+ inline-size: calc(100% - var(--size-6));
3420
+ }
3421
+ }
3422
+
3423
+ /* Select */
3424
+ &:has(select) {
3425
+ .label {
3426
+ /* Make sure chevron is visible */
3427
+ inline-size: calc(100% - var(--size-6));
3428
+ }
3429
+ }
3430
+
3431
+ /* Experimental Select */
3432
+ &:has(select button) {
3433
+ select {
3434
+ padding: 0;
3435
+
3436
+ button {
3437
+ outline: 0;
3438
+ padding: var(--_field-padding-block) var(--size-8)
3439
+ var(--_field-padding-block) var(--_field-padding-inline);
3440
+ }
3441
+ }
3442
+ }
3443
+
3444
+ /* Non-experimental Select */
3445
+ &:has(select):not(:has(button)) {
3446
+ select {
3447
+ padding: var(--_field-padding-block) var(--size-8)
3448
+ var(--_field-padding-block) var(--_field-padding-inline);
3449
+ }
3450
+ }
3451
+
3452
+ /* Input - color */
3453
+ &:has(input[type="color"]) {
3454
+ input {
3455
+ appearance: none;
3456
+ background: none;
3457
+ block-size: var(--_height);
3458
+ inline-size: var(--_height);
3459
+ overflow: hidden;
3460
+ padding: 0;
3461
+
3462
+ &::-webkit-color-swatch {
3463
+ border: none;
3464
+ }
3465
+
3466
+ &::-webkit-color-swatch-wrapper {
3467
+ padding: 0;
3468
+ }
3469
+ }
3470
+ }
3471
+
3472
+ /* Element states */
3473
+ &:hover {
3474
+ &:not(.error) {
3475
+ :where(input, textarea, select) {
3476
+ --_border-color: var(--text-color-1);
3477
+ }
3478
+ }
3479
+ }
3480
+
3481
+ &:focus-within {
3482
+ & input,
3483
+ & textarea,
3484
+ & select {
3485
+ border-color: var(--_accent-color);
3486
+ outline-offset: -2px;
3487
+ outline: 2px solid var(--_accent-color);
3488
+ }
3489
+ }
3490
+
3491
+ /* Label */
3492
+ .label {
3493
+ font-size: var(--font-size-sm);
3494
+ grid-column: 1/-1;
3495
+ grid-row: 1;
3496
+ }
3497
+
3498
+ /* Supporting text */
3499
+ .supporting-text {
3500
+ color: var(--_supporting-text-color);
3501
+ font-size: var(--font-size-xs);
3502
+ grid-column: 1/-1;
3503
+ grid-row: 3;
3504
+ line-height: 1.5;
3505
+ }
3506
+
3507
+ /* Auto-fit */
3508
+ &.auto-fit {
3509
+ inline-size: auto;
3510
+
3511
+ :where(& input, & textarea) {
3512
+ field-sizing: content;
3513
+ inline-size: auto;
3514
+ }
3515
+ }
3516
+
3517
+ /* Validation */
3518
+ &.error {
3519
+ --_accent-color: var(--color-9);
3520
+ --_border-color: var(--color-9);
3521
+ --_filled-border-color: var(--color-9);
3522
+ --_label-color: var(--color-9);
3523
+ --_supporting-text-color: var(--color-9);
3524
+ }
3525
+
3526
+ /*
3527
+ * Variant: Filled
3528
+ */
3529
+ &.filled {
3530
+ --_bg-color: var(--surface-tonal);
3531
+
3532
+ &:not(:has([disabled], :has(input[type="color"]))) {
3533
+ /* Hover */
3534
+ &:hover {
3535
+ --_bg-color: light-dark(
3536
+ oklch(from var(--surface-tonal) calc(l * 0.93) c h),
3537
+ oklch(from var(--surface-tonal) calc(l * 1.1) c h)
3538
+ );
3539
+ }
3540
+ }
3541
+ }
3542
+
3543
+ /* Disabled */
3544
+ &:where(:has([disabled])) {
3545
+ &::before {
3546
+ display: none;
3547
+ }
3548
+ :where(input, textarea, select) {
3549
+ cursor: not-allowed;
3550
+ opacity: 0.7;
3551
+
3552
+ * {
3553
+ pointer-events: none;
3554
+ }
3555
+ }
3556
+ }
3557
+
3558
+ /* Read-only */
3559
+ &:where(:has([readonly])) {
3560
+ &::before {
3561
+ display: none;
3562
+ }
3563
+ :where(input, textarea, select) {
3564
+ cursor: not-allowed;
3565
+
3566
+ * {
3567
+ pointer-events: none;
3568
+ }
3569
+ }
3570
+ }
3571
+
3572
+ /* Sizes */
3573
+ &.small {
3574
+ --_field-padding-block: var(--size-2);
3575
+ --_height: var(--field-size-small);
3576
+
3577
+ &:has(input[type="color"]) {
3578
+ .label {
3579
+ line-height: 1.5;
3580
+ }
3581
+ }
3582
+ }
3583
+ }
3584
+ }
3585
+
3586
+ @layer components.extended {
3587
+ :where(.field > select) {
3588
+ position: relative;
3589
+
3590
+ /* Default arrow */
3591
+ &::picker-icon {
3592
+ block-size: 0;
3593
+ border-block-start: 5px solid;
3594
+ border-inline: 5px solid transparent;
3595
+ color: currentColor;
3596
+ content: "";
3597
+ inline-size: 0;
3598
+ inset: 50% var(--size-3) auto auto;
3599
+ pointer-events: none;
3600
+ position: absolute;
3601
+ translate: 0 -50%;
3602
+ }
3603
+
3604
+ &:open {
3605
+ &::picker-icon {
3606
+ rotate: 180deg;
3607
+ }
3608
+ }
3609
+
3610
+ /* Select popover */
3611
+ &::picker(select) {
3612
+ /* Animation on-stage styles */
3613
+ border: 0;
3614
+ box-shadow: var(--shadow-2);
3615
+ opacity: 1;
3616
+ padding: 0;
3617
+ scale: 1;
3618
+
3619
+ /* Animation starting styles */
3620
+ @starting-style {
3621
+ opacity: 0;
3622
+ transform: scale(0.9);
3623
+ }
3624
+
3625
+ @media (prefers-reduced-motion: no-preference) {
3626
+ transition: display 0.2s allow-discrete, opacity 0.2s var(--ease-3),
3627
+ overlay 0.2s allow-discrete, scale 0.2s var(--ease-3);
3628
+ }
3629
+ }
3630
+
3631
+ /* Animation off-stage styles */
3632
+ &:not(:open)::picker(select) {
3633
+ opacity: 0;
3634
+ scale: 0.9;
3635
+ }
3636
+
3637
+ button {
3638
+ background-color: transparent;
3639
+ display: flex;
3640
+ inline-size: 100%;
3641
+ margin: 0;
3642
+ position: relative;
3643
+
3644
+ selectedcontent {
3645
+ overflow: hidden;
3646
+ text-overflow: ellipsis;
3647
+ white-space: nowrap;
3648
+ }
3649
+ }
3650
+
3651
+ .list {
3652
+ /* Groups */
3653
+ [role="group"] {
3654
+ label {
3655
+ background-color: light-dark(var(--gray-3), var(--gray-13));
3656
+ color: light-dark(
3657
+ oklch(from var(--text-color-1) calc(l * 0.75) c h),
3658
+ oklch(from var(--text-color-1) calc(l * 1.25) c h)
3659
+ );
3660
+ font-weight: 500;
3661
+ overflow: hidden;
3662
+ padding-inline: var(--size-2);
3663
+ text-overflow: ellipsis;
3664
+ white-space: nowrap;
3665
+ }
3666
+
3667
+ &:not(:first-child),
3668
+ option:first-of-type {
3669
+ margin-block-start: var(--size-2);
3670
+ }
3671
+
3672
+ option:last-of-type,
3673
+ &:last-child {
3674
+ option:last-of-type {
3675
+ margin-block-end: 0;
3676
+ }
3677
+ }
3678
+ }
3679
+
3680
+ /* Option */
3681
+ option {
3682
+ /* Checkmark */
3683
+ /* TODO - checkmark should be the final version of the checkmark API. Follow the development of this and remove redundant psuedo stuff. */
3684
+ &::check {
3685
+ display: none;
3686
+ }
3687
+ &::checkmark {
3688
+ display: none;
3689
+ }
3690
+ &::before {
3691
+ display: none;
3692
+ }
3693
+
3694
+ &:focus-visible {
3695
+ outline-offset: -1px;
3696
+ }
3697
+ }
3698
+ }
3699
+ }
3700
+
3701
+ :where(.field:has(> select)) {
3702
+ /* Size */
3703
+ &.small {
3704
+ button {
3705
+ padding-inline: var(--size-2) var(--size-7);
3706
+
3707
+ &::after {
3708
+ inset-inline-end: var(--size-2);
3709
+ }
3710
+ }
3711
+ }
3712
+
3713
+ /*
3714
+ * Non-experimental Select
3715
+ *
3716
+ * Hack to get the arrow working. Pseudo elements aren't allowed on the `<select>` element, so need to add it on the `.field` class instead. Noting this down if an `:after` element would be needed on a `.field`.
3717
+ */
3718
+ &:not(:has(button)) {
3719
+ select {
3720
+ appearance: none;
3721
+ }
3722
+
3723
+ /* Arrow */
3724
+ &::after {
3725
+ align-self: center;
3726
+ block-size: 0;
3727
+ border-block-start: 5px solid;
3728
+ border-inline: 5px solid transparent;
3729
+ content: "";
3730
+ display: inline-block;
3731
+ flex-shrink: 0;
3732
+ grid-column: 1/-1;
3733
+ grid-row: 2;
3734
+ inline-size: 0;
3735
+ inset-inline-end: var(--size-3);
3736
+ justify-self: end;
3737
+ pointer-events: none;
3738
+ position: relative;
3739
+ }
3740
+ }
3741
+ }
3742
+
3743
+ select:has(button),
3744
+ ::picker(select) {
3745
+ appearance: base-select;
3746
+ }
3747
+ }
3748
+
3749
+ @layer components.extended {
3750
+ :where(
3751
+ .field:has(
3752
+ :where(
3753
+ input[type="date"],
3754
+ input[type="datetime-local"],
3755
+ input[type="email"],
3756
+ input[type="month"],
3757
+ input[type="number"],
3758
+ input[type="password"],
3759
+ input[type="search"],
3760
+ input[type="tel"],
3761
+ input[type="text"],
3762
+ input[type="time"],
3763
+ input[type="url"],
3764
+ input[type="week"]
3765
+ )
3766
+ )
3767
+ ) {
3768
+ /* Sizes */
3769
+ &.small {
3770
+ input {
3771
+ padding-inline: var(--size-2);
3772
+ }
3773
+ }
3774
+ }
3775
+
3776
+ /* Autosuggest */
3777
+ :where(.field:has(input[list])) {
3778
+ /* Hide native arrow */
3779
+ input::-webkit-calendar-picker-indicator {
3780
+ opacity: 0;
3781
+ position: absolute;
3782
+ cursor: pointer;
3783
+ pointer-events: none;
3784
+ }
3785
+ }
3786
+ :where(
3787
+ .field:has(input[list]:placeholder-shown),
3788
+ .field:has(input[list]):where(:focus-within, :hover)
3789
+ ) {
3790
+ /* Arrow */
3791
+ &::after {
3792
+ block-size: 0;
3793
+ border-block-start: 5px solid;
3794
+ border-inline: 5px solid transparent;
3795
+ content: "";
3796
+ display: inline-block;
3797
+ flex-shrink: 0;
3798
+ inline-size: 0;
3799
+ inset: 50% var(--size-3) auto auto;
3800
+ pointer-events: none;
3801
+ position: absolute;
3802
+ translate: 0 -50%;
3803
+ }
3804
+ }
3805
+ }
3806
+
3807
+ @layer components.extended {
3808
+ :where(.field:has(textarea)) {
3809
+ textarea {
3810
+ block-size: auto;
3811
+ field-sizing: content;
3812
+ min-block-size: 5rem;
3813
+ resize: vertical;
3814
+ }
3815
+
3816
+ /* Size */
3817
+ &.small {
3818
+ textarea {
3819
+ min-block-size: var(--_height);
3820
+ }
3821
+ }
3822
+
3823
+ /* Auto-fit */
3824
+ &.auto-fit {
3825
+ textarea {
3826
+ min-block-size: var(--_height);
3827
+ resize: both;
3828
+ }
3829
+ }
3830
+ }
3831
+ }
3832
+
3833
+ @layer components.extended {
3834
+ @scope (.rich-text) to (.not-rich-text) {
3835
+ a {
3836
+ color: var(--primary);
3837
+ cursor: pointer;
3838
+ font-size: inherit;
3839
+ font-weight: 700;
3840
+ line-height: inherit;
3841
+ text-decoration: underline;
3842
+ text-decoration-color: var(--primary);
3843
+ text-underline-offset: 2px;
3844
+
3845
+ &[href] {
3846
+ &:hover,
3847
+ &:focus-visible {
3848
+ color: var(--primary-light);
3849
+ }
3850
+ }
3851
+ }
3852
+
3853
+ /* Blockquote */
3854
+ blockquote {
3855
+ font-size: inherit;
3856
+ line-height: inherit;
3857
+ :first-child {
3858
+ margin-block-start: 0;
3859
+ }
3860
+
3861
+ :last-child {
3862
+ margin-block-end: 0;
3863
+ }
3864
+ }
3865
+
3866
+ /* Text */
3867
+ p {
3868
+ font-size: inherit;
3869
+ line-height: inherit;
3870
+ margin-block: 1.25em;
3871
+ }
3872
+
3873
+ :is(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
3874
+ color: var(--text-color-1);
3875
+
3876
+ & + *:not(&) {
3877
+ margin-block-start: 0;
3878
+ }
3879
+ }
3880
+
3881
+ h1,
3882
+ .h1 {
3883
+ font-size: var(--font-size-h1, var(--font-size-7));
3884
+ letter-spacing: -0.02em;
3885
+ line-height: 1.1111111;
3886
+ margin-block: 0 0.8888889em;
3887
+ }
3888
+
3889
+ h2,
3890
+ .h2 {
3891
+ font-size: var(--font-size-h2, var(--font-size-5, 2rem));
3892
+ letter-spacing: -0.02em;
3893
+ line-height: 1.3333333;
3894
+ margin-block: 2em 1em;
3895
+ }
3896
+
3897
+ h3,
3898
+ .h3 {
3899
+ font-size: var(--font-size-h3, var(--font-size-4, 1.5rem));
3900
+ letter-spacing: -0.01em;
3901
+ line-height: 1.6;
3902
+ margin-block: 1.6em 0.6em;
3903
+ }
3904
+
3905
+ h4,
3906
+ .h4 {
3907
+ font-size: var(--font-size-h4, var(--font-size-3, 1.25rem));
3908
+ letter-spacing: -0.01em;
3909
+ line-height: 1.5;
3910
+ margin-block: 1.5em 0.5em;
3911
+ }
3912
+
3913
+ h5,
3914
+ .h5 {
3915
+ font-size: var(--font-size-h5, var(--font-size-2, 1.1rem));
3916
+ line-height: 1;
3917
+ margin-block: 0 var(--size-1);
3918
+ }
3919
+
3920
+ h6,
3921
+ .h6 {
3922
+ font-size: var(--font-size-h6, var(--font-size-1, 1rem));
3923
+ line-height: 1;
3924
+ margin-block: 0 var(--size-1);
3925
+ }
3926
+
3927
+ /** Overline */
3928
+ :where(.overline, hgroup > :where(p, .p):first-of-type:first-child) {
3929
+ color: light-dark(
3930
+ oklch(from var(--text-color-2) calc(l * 1.25) c h),
3931
+ oklch(from var(--text-color-2) calc(l * 0.75) c h)
3932
+ );
3933
+ font-size: var(--font-size-xs);
3934
+ font-weight: 500;
3935
+ letter-spacing: 0.06em;
3936
+ line-height: 2.5;
3937
+ text-transform: uppercase;
3938
+ }
3939
+
3940
+ hgroup {
3941
+ & > p {
3942
+ margin: 0;
3943
+ }
3944
+
3945
+ & > :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
3946
+ margin-block-end: 0.4em;
3947
+ }
3948
+
3949
+ & + * {
3950
+ margin-block-start: 3em;
3951
+ }
3952
+
3953
+ /* The second p element */
3954
+ & > :where(p, .p):last-of-type:last-child:not(:first-child) {
3955
+ color: oklch(from currentColor l c h / 75%);
3956
+ font-size: var(--font-size-lg);
3957
+ line-height: 1.6;
3958
+ }
3959
+ }
3960
+
3961
+ /* Lists */
3962
+ ul:not([class]) {
3963
+ list-style-type: disc;
3964
+ }
3965
+
3966
+ ol:not([class]) {
3967
+ list-style-type: decimal;
3968
+ }
3969
+
3970
+ :where(ul, ol):not([class]) {
3971
+ display: grid;
3972
+ font-size: inherit;
3973
+ gap: 0.5em;
3974
+ line-height: inherit;
3975
+ margin-block-start: 1.25em;
3976
+ margin-block-end: 1.25em;
3977
+ padding-inline-start: 1.625em;
3978
+
3979
+ li {
3980
+ padding-inline-start: 0.375em;
3981
+ }
3982
+ }
3983
+
3984
+ /* Nested lists */
3985
+ :where(ul ul),
3986
+ :where(ul ol),
3987
+ :where(ol ul),
3988
+ :where(ol ol) {
3989
+ margin-block-start: 0.75em;
3990
+ margin-block-end: 0.75em;
3991
+ }
3992
+
3993
+ /* Description lists */
3994
+ :where(dl) {
3995
+ font-size: inherit;
3996
+ line-height: inherit;
3997
+ margin-block-start: 1.25em;
3998
+ margin-block-end: 1.25em;
3999
+
4000
+ dt {
4001
+ margin-block-start: 1.25em;
4002
+ }
4003
+
4004
+ dd {
4005
+ margin-block-start: 0.5em;
4006
+ padding-inline-start: 1.625em;
4007
+ }
4008
+ }
4009
+
4010
+ /* Figures */
4011
+ figure {
4012
+ margin-block: 2em;
4013
+
4014
+ & > * {
4015
+ margin-block: 0;
4016
+ }
4017
+
4018
+ & figcaption {
4019
+ font-size: 0.875em;
4020
+ line-height: 1.4285714;
4021
+ margin-block-start: 0.8571429em;
4022
+ }
4023
+ }
4024
+
4025
+ /* Remove top margin from first child */
4026
+ & > :first-child {
4027
+ margin-block-start: 0;
4028
+ }
4029
+
4030
+ /* Remove bottom margin from last child */
4031
+ & > :last-child {
4032
+ margin-block-end: 0;
4033
+ }
4034
+
4035
+ /* Horizontal rules */
4036
+ hr {
4037
+ & + * {
4038
+ margin-block-start: 0;
4039
+ }
4040
+ }
4041
+ }
4042
+ }
4043
+
4044
+ /* Utils */
4045
+
4046
+ @layer utils {
4047
+ /*
4048
+ Screen-reader only
4049
+ When you visibly want to hide an element but make it accessible for screen readers.
4050
+ */
4051
+ .sr-only {
4052
+ block-size: 1px;
4053
+ clip-path: inset(50%);
4054
+ inline-size: 1px;
4055
+ overflow: hidden;
4056
+ position: absolute;
4057
+ white-space: nowrap;
4058
+ }
4059
+
4060
+ /* Hover and active effect for checkbox, radio and icon buttons */
4061
+ :where(.checkbox input, .radio input, .icon-button) {
4062
+ --isLTR: 1;
4063
+ --isRTL: -1;
4064
+
4065
+ position: relative;
4066
+ transform-style: preserve-3d;
4067
+
4068
+ &:dir(rtl) {
4069
+ --isLTR: -1;
4070
+ --isRTL: 1;
4071
+ }
4072
+
4073
+ &:where(:not([disabled])) {
4074
+ &:hover:before {
4075
+ --thumb-scale: 1;
4076
+ }
4077
+
4078
+ &:active:before {
4079
+ --thumb-scale: 1.1;
4080
+ }
4081
+
4082
+ &::before {
4083
+ --thumb-scale: 0.01;
4084
+ --highlight-size: 150%;
4085
+
4086
+ background-color: oklch(0.6 0 0 / 0.2);
4087
+ block-size: var(--highlight-size);
4088
+ clip-path: circle(50%);
4089
+ content: "";
4090
+ inline-size: var(--highlight-size);
4091
+ inset-block-start: 50%;
4092
+ inset-inline-start: 50%;
4093
+ position: absolute;
4094
+ transform-origin: center center;
4095
+ transform: translateX(calc(var(--isRTL) * 50%)) translateY(-50%)
4096
+ translateZ(-1px) scale(var(--thumb-scale));
4097
+ will-change: transform;
4098
+
4099
+ @media (prefers-reduced-motion: no-preference) {
4100
+ transition: transform 0.2s ease;
4101
+ }
4102
+ }
4103
+ }
4104
+ }
4105
+ }