opui-css 3.2.0 → 3.3.0

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,4141 @@
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:
1926
+ background-color var(--_transition-time) 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:
1946
+ background-color var(--_transition-time) 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
+ /* Icons */
1968
+ &:has(.icon-checked, .icon-unchecked) {
1969
+ [role="switch"] {
1970
+ grid-column: 1 / -1;
1971
+ grid-row: 1;
1972
+ }
1973
+
1974
+ &:has([role="switch"]:checked) {
1975
+ .icon-unchecked {
1976
+ display: none;
1977
+ }
1978
+ .icon-checked {
1979
+ display: block;
1980
+ }
1981
+ }
1982
+
1983
+ .icon-checked {
1984
+ display: none;
1985
+ }
1986
+
1987
+ svg {
1988
+ grid-column: 1;
1989
+ grid-row: 1;
1990
+ inline-size: var(--_dot-size);
1991
+ margin-inline-start: calc(
1992
+ var(--_track-width) - var(--_dot-size) - var(--size-1)
1993
+ );
1994
+ pointer-events: none;
1995
+ z-index: 1;
1996
+
1997
+ &.icon-checked {
1998
+ margin-inline-start: var(--size-1);
1999
+ }
2000
+ }
2001
+ }
2002
+
2003
+ /* Required dot */
2004
+ &:has([required]:not(:checked)) {
2005
+ .label:after {
2006
+ color: var(--red);
2007
+ content: "*";
2008
+ inset: 0 -0.25ex auto auto;
2009
+ position: absolute;
2010
+ }
2011
+ }
2012
+
2013
+ /* Disabled */
2014
+ &:has([disabled]) {
2015
+ cursor: not-allowed;
2016
+ opacity: 0.64;
2017
+ user-select: none;
2018
+
2019
+ input {
2020
+ cursor: not-allowed;
2021
+ }
2022
+ }
2023
+
2024
+ /* Label */
2025
+ .label {
2026
+ grid-column: 2;
2027
+ grid-row: 1;
2028
+ min-width: 0;
2029
+ padding-inline: 0 1ex;
2030
+ position: relative;
2031
+ user-select: none;
2032
+ }
2033
+
2034
+ /* Supporting text */
2035
+ .supporting-text {
2036
+ color: var(--text-color-2);
2037
+ font-size: var(--font-size-xs);
2038
+ grid-column: 2;
2039
+ grid-row: 2;
2040
+ line-height: 1.5;
2041
+ z-index: 1;
2042
+ }
2043
+
2044
+ /* Size */
2045
+ &.small {
2046
+ --_dot-size: 0.75rem;
2047
+ --_track-height: var(--size-4);
2048
+ --_track-width: 2.5rem;
2049
+ }
2050
+
2051
+ /* Stacked layout */
2052
+ &.stack {
2053
+ justify-items: center;
2054
+ grid-auto-columns: unset;
2055
+
2056
+ .label {
2057
+ grid-column: 1/-1;
2058
+ grid-row: 2;
2059
+ margin-block-start: var(--size-1);
2060
+ padding-inline: 1ex;
2061
+ }
2062
+
2063
+ .supporting-text {
2064
+ grid-column: 1/-1;
2065
+ grid-row: 3;
2066
+ }
2067
+ }
2068
+
2069
+ /* Validation */
2070
+ &.error {
2071
+ input {
2072
+ outline: 2px solid var(--color-9);
2073
+ border-radius: var(--radius-round);
2074
+ }
2075
+
2076
+ .label,
2077
+ .supporting-text {
2078
+ color: var(--color-9);
2079
+ }
2080
+ }
2081
+ }
2082
+ }
2083
+
2084
+ @layer components.root {
2085
+ :where(.range > input[type="range"]) {
2086
+ --thumb-bg: var(--primary);
2087
+ --thumb-highlight-color: oklch(from var(--primary) 70% 100% h / 20%);
2088
+ --thumb-highlight-size: 0px;
2089
+ --thumb-offset: -1ex;
2090
+ --thumb-size: 3ex;
2091
+ --track-color: var(--field-border-color);
2092
+ --track-fill: 0%;
2093
+ --track-height: 1ex;
2094
+
2095
+ appearance: none;
2096
+ background: transparent;
2097
+ display: block;
2098
+ inline-size: 100%;
2099
+ margin: 1ex 0 3ex;
2100
+ outline-offset: 1ex;
2101
+
2102
+ @media (hover: none) {
2103
+ --thumb-offset: -14px;
2104
+ --thumb-size: 30px;
2105
+ }
2106
+
2107
+ /* Track */
2108
+ &::-webkit-slider-runnable-track {
2109
+ appearance: none;
2110
+ background: linear-gradient(
2111
+ to right,
2112
+ transparent var(--track-fill),
2113
+ var(--track-color) 0%
2114
+ ),
2115
+ var(--primary);
2116
+ block-size: var(--track-height);
2117
+ border-radius: 5ex;
2118
+ box-shadow: var(--inner-shadow-1);
2119
+ }
2120
+
2121
+ &::-moz-range-track {
2122
+ appearance: none;
2123
+ background: linear-gradient(
2124
+ to right,
2125
+ transparent var(--track-fill),
2126
+ var(--track-color) 0%
2127
+ ),
2128
+ var(--primary);
2129
+ block-size: var(--track-height);
2130
+ border-radius: 5ex;
2131
+ box-shadow: var(--inner-shadow-2);
2132
+ }
2133
+
2134
+ /* Ring */
2135
+ &::-webkit-slider-thumb {
2136
+ appearance: none;
2137
+ background: var(--thumb-bg);
2138
+ block-size: var(--thumb-size);
2139
+ border-radius: 50%;
2140
+ border: 3px solid var(--surface-default);
2141
+ box-shadow: 0 0 0 var(--thumb-highlight-size) var(--thumb-highlight-color);
2142
+ cursor: ew-resize;
2143
+ inline-size: var(--thumb-size);
2144
+ margin-block-start: var(--thumb-offset);
2145
+
2146
+ @media (prefers-reduced-motion: no-preference) {
2147
+ transition: box-shadow 0.1s ease;
2148
+ }
2149
+
2150
+ .fieldset-item:focus-within & {
2151
+ border-color: var(--gray-14);
2152
+ }
2153
+ }
2154
+
2155
+ &::-moz-range-thumb {
2156
+ appearance: none;
2157
+ background: var(--thumb-bg);
2158
+ block-size: var(--thumb-size);
2159
+ border-radius: 50%;
2160
+ border: 3px solid var(--primary);
2161
+ box-shadow: 0 0 0 var(--thumb-highlight-size) var(--thumb-highlight-color);
2162
+ cursor: ew-resize;
2163
+ inline-size: var(--thumb-size);
2164
+ margin-block-start: var(--thumb-offset);
2165
+
2166
+ @media (prefers-reduced-motion: no-preference) {
2167
+ transition: box-shadow 0.1s ease;
2168
+ }
2169
+
2170
+ .fieldset-item:focus-within & {
2171
+ border-color: var(--gray-14);
2172
+ }
2173
+ }
2174
+
2175
+ /* Element state */
2176
+ &:not([disabled]) {
2177
+ &:hover {
2178
+ --thumb-highlight-size: var(--size-1);
2179
+ }
2180
+
2181
+ &:active {
2182
+ --thumb-highlight-size: var(--size-2);
2183
+ --track-color: light-dark(
2184
+ oklch(from var(--field-border-color) calc(l * 0.9) c h),
2185
+ oklch(from var(--field-border-color) calc(l * 1.1) c h)
2186
+ );
2187
+ }
2188
+ }
2189
+
2190
+ &[disabled] {
2191
+ --thumb-bg: oklch(from var(--text-color-1) l c h / 50%);
2192
+ --track-color: var(--field-border-color);
2193
+
2194
+ cursor: not-allowed;
2195
+
2196
+ &::-webkit-slider-thumb {
2197
+ cursor: not-allowed;
2198
+ }
2199
+ &::-moz-range-thumb {
2200
+ cursor: not-allowed;
2201
+ }
2202
+ }
2203
+ }
2204
+ }
2205
+
2206
+ @layer components.root {
2207
+ /* Base typography */
2208
+ :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
2209
+ color: var(--text-color-1);
2210
+ font-weight: 700;
2211
+ text-wrap: pretty;
2212
+ }
2213
+
2214
+ :where(h1, .h1) {
2215
+ font-size: var(--font-size-h1, var(--font-size-7));
2216
+ letter-spacing: -0.02em;
2217
+ line-height: 1.15;
2218
+ }
2219
+
2220
+ :where(h2, .h2) {
2221
+ font-size: var(--font-size-h2, var(--font-size-5, 2rem));
2222
+ letter-spacing: -0.02em;
2223
+ line-height: 1.2;
2224
+ }
2225
+
2226
+ :where(h3, .h3) {
2227
+ font-size: var(--font-size-h3, var(--font-size-4, 1.5rem));
2228
+ letter-spacing: -0.01em;
2229
+ line-height: 1.167;
2230
+ }
2231
+
2232
+ :where(h4, .h4) {
2233
+ font-size: var(--font-size-h4, var(--font-size-3, 1.25rem));
2234
+ letter-spacing: -0.01em;
2235
+ line-height: 1.235;
2236
+ }
2237
+
2238
+ :where(h5, .h5) {
2239
+ font-size: var(--font-size-h5, var(--font-size-2, 1.1rem));
2240
+ line-height: 1.334;
2241
+ }
2242
+
2243
+ :where(h6, .h6) {
2244
+ font-size: var(--font-size-h6, var(--font-size-1, 1rem));
2245
+ line-height: 1;
2246
+ }
2247
+
2248
+ :where(hgroup) {
2249
+ & > :where(p, .p) {
2250
+ margin: 0;
2251
+ }
2252
+
2253
+ & > :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
2254
+ margin-block-end: 0.4em;
2255
+ }
2256
+
2257
+ /* The second p element */
2258
+ & > :where(p, .p):last-of-type:last-child:not(:first-child) {
2259
+ color: oklch(from currentColor l c h / 75%);
2260
+ font-size: var(--font-size-lg);
2261
+ line-height: 1.6;
2262
+ }
2263
+ }
2264
+
2265
+ /** Overline */
2266
+ :where(.overline, hgroup > :where(p, .p):first-of-type:first-child) {
2267
+ color: light-dark(
2268
+ oklch(from var(--text-color-2) calc(l * 1.25) c h),
2269
+ oklch(from var(--text-color-2) calc(l * 0.75) c h)
2270
+ );
2271
+ font-size: var(--font-size-xs);
2272
+ font-weight: 500;
2273
+ letter-spacing: 0.06em;
2274
+ line-height: 2.5;
2275
+ text-transform: uppercase;
2276
+ }
2277
+
2278
+ :where(p, .p) {
2279
+ text-wrap: pretty;
2280
+
2281
+ &.small {
2282
+ font-size: var(--font-size-md);
2283
+ }
2284
+ &.large {
2285
+ font-size: var(--font-size-lg);
2286
+ }
2287
+ }
2288
+
2289
+ /* Inline text elements */
2290
+ :where(ins, u, abbr, dfn) {
2291
+ text-decoration: underline;
2292
+ text-underline-offset: 1px;
2293
+
2294
+ @supports (-moz-appearance: none) {
2295
+ text-underline-offset: 2px;
2296
+ }
2297
+ }
2298
+
2299
+ :where(abbr, dfn) {
2300
+ font-style: normal;
2301
+ text-decoration: var(--color-9) underline dotted;
2302
+
2303
+ &[title] {
2304
+ cursor: help;
2305
+ text-underline-offset: 1px;
2306
+ }
2307
+
2308
+ @supports (-moz-appearance: none) {
2309
+ text-underline-offset: 2px;
2310
+ }
2311
+ }
2312
+
2313
+ :where(sup) {
2314
+ font-size: 0.5em;
2315
+ }
2316
+
2317
+ :where(del, ins) {
2318
+ color: var(--color-9);
2319
+ }
2320
+
2321
+ :where(small) {
2322
+ font-size: max(0.5em, var(--font-size-0, 0.75rem));
2323
+ max-inline-size: var(--size-content-1);
2324
+ }
2325
+
2326
+ :where(cite) {
2327
+ font-style: italic;
2328
+ }
2329
+
2330
+ /* Blockquote */
2331
+ :where(blockquote) {
2332
+ border-inline-start-width: var(--border-size-3);
2333
+ display: grid;
2334
+ gap: var(--size-3);
2335
+ padding-block: var(--size-3);
2336
+ padding-inline: var(--size-4);
2337
+
2338
+ :first-child {
2339
+ margin-block-start: 0;
2340
+ }
2341
+
2342
+ :last-child {
2343
+ margin-block-end: 0;
2344
+ }
2345
+
2346
+ footer {
2347
+ color: var(--text-color-2);
2348
+ }
2349
+ }
2350
+
2351
+ /* Code */
2352
+ :where(pre) {
2353
+ border-radius: 0.375rem;
2354
+ direction: ltr;
2355
+ font-size: 0.875rem;
2356
+ line-height: 1.7142857;
2357
+ margin-block: 1.7142857em;
2358
+ max-inline-size: max-content;
2359
+ min-inline-size: 0;
2360
+ padding-block: 0.8571429em;
2361
+ padding-inline: 1.1428571em;
2362
+ white-space: pre;
2363
+ writing-mode: lr;
2364
+ }
2365
+
2366
+ :where(code, kbd, samp, pre) {
2367
+ font-family: var(--font-mono);
2368
+ }
2369
+
2370
+ :where(code) {
2371
+ background-color: oklch(00 0 0 /18%);
2372
+ border-radius: var(--border-size-3);
2373
+ font-size: 0.9em;
2374
+ padding: 0.2ex 0.5ex;
2375
+ }
2376
+
2377
+ :where(kbd, var) {
2378
+ background-color: var(--text-color-2);
2379
+ border-color: var(--text-color-2);
2380
+ border-radius: var(--border-radius, var(--radius-2));
2381
+ border-width: var(--border-size-1);
2382
+ color: var(--text-color-2-contrast);
2383
+ padding: calc(var(--size-1) / 2) var(--size-1);
2384
+ }
2385
+
2386
+ :where(:not(pre) code, kbd) {
2387
+ word-break: break-word;
2388
+ }
2389
+
2390
+ :where(:not(pre) code) {
2391
+ border-radius: var(--border-radius, var(--radius-2));
2392
+ padding: var(--size-1) var(--size-2);
2393
+ writing-mode: lr;
2394
+ }
2395
+
2396
+ :where(mark) {
2397
+ border-radius: var(--border-radius, 0);
2398
+ box-decoration-break: clone;
2399
+ padding: calc(var(--size-1) / 2) var(--size-1);
2400
+ vertical-align: baseline;
2401
+ }
2402
+
2403
+ /* Misc */
2404
+ :where(dt) {
2405
+ font-weight: 700;
2406
+ }
2407
+
2408
+ :where(figure) {
2409
+ & > :where(figcaption) {
2410
+ font-size: var(--font-size-1, 1rem);
2411
+ text-wrap: balance;
2412
+ }
2413
+ }
2414
+ }
2415
+
2416
+ /*** Extended components (has dependencies) */
2417
+
2418
+ @layer components.extended {
2419
+ :where([role="group"].button-group) {
2420
+ --_border-radius: var(--button-border-radius);
2421
+
2422
+ border-radius: var(--_border-radius);
2423
+ display: inline-flex;
2424
+ min-width: max-content;
2425
+
2426
+ button {
2427
+ border-radius: 0;
2428
+
2429
+ svg {
2430
+ max-inline-size: 0.7lh;
2431
+ }
2432
+
2433
+ &:focus-visible {
2434
+ outline-offset: -4px;
2435
+ }
2436
+
2437
+ & + & {
2438
+ border-inline-width: 1px;
2439
+ margin-inline-start: -1px;
2440
+ }
2441
+
2442
+ &:first-of-type {
2443
+ border-bottom-left-radius: var(--_border-radius);
2444
+ border-top-left-radius: var(--_border-radius);
2445
+ }
2446
+ &:last-of-type {
2447
+ border-bottom-right-radius: var(--_border-radius);
2448
+ border-top-right-radius: var(--_border-radius);
2449
+ }
2450
+
2451
+ /* Variants */
2452
+ &:where(.tonal, .filled) {
2453
+ & + button {
2454
+ border-inline-start-color: var(--color-7);
2455
+ }
2456
+
2457
+ & + &[disabled] {
2458
+ border-inline-start-color: color-mix(
2459
+ in oklch,
2460
+ var(--border-color) 90%,
2461
+ white
2462
+ );
2463
+ }
2464
+ }
2465
+ }
2466
+ }
2467
+ }
2468
+
2469
+ @layer components.extended {
2470
+ :where(details) {
2471
+ --_accordion-transition-time: 0.2s;
2472
+ --_bg-color: transparent;
2473
+ --_margin-inline: var(--size-1);
2474
+ --_shadow: none;
2475
+
2476
+ background-color: var(--_bg-color);
2477
+ box-shadow: var(--_shadow);
2478
+ border-radius: var(--border-radius, 4px);
2479
+ display: block;
2480
+ margin-inline: var(--_margin-inline);
2481
+ transition: all var(--_accordion-transition-time) ease-out;
2482
+
2483
+ /* Accordion animation */
2484
+ /* https://nerdy.dev/open-and-close-transitions-for-the-details-element */
2485
+ @media (prefers-reduced-motion: no-preference) {
2486
+ interpolate-size: allow-keywords;
2487
+ }
2488
+
2489
+ &::details-content {
2490
+ block-size: 0;
2491
+ opacity: 0;
2492
+ overflow-y: clip;
2493
+ transition: content-visibility var(--_accordion-transition-time)
2494
+ allow-discrete,
2495
+ opacity var(--_accordion-transition-time),
2496
+ block-size var(--_accordion-transition-time);
2497
+ }
2498
+
2499
+ &[open]::details-content {
2500
+ block-size: auto;
2501
+ opacity: 1;
2502
+ }
2503
+ /***/
2504
+
2505
+ & > summary {
2506
+ background-color: inherit;
2507
+ cursor: pointer;
2508
+ font-weight: 700;
2509
+ padding-block: var(--size-3);
2510
+ user-select: none;
2511
+ }
2512
+
2513
+ /* Custom arrow */
2514
+ /* summary {
2515
+ align-items: center;
2516
+ background-color: inherit;
2517
+ cursor: pointer;
2518
+ display: flex;
2519
+ justify-content: space-between;
2520
+ list-style: none;
2521
+ padding-block: var(--size-3);
2522
+ user-select: none;
2523
+
2524
+ &::marker,
2525
+ &::-webkit-details-marker {
2526
+ display: none;
2527
+ }
2528
+
2529
+ svg {
2530
+ transition: rotate 0.2s ease-out;
2531
+ }
2532
+ }
2533
+
2534
+ &[open] > summary svg {
2535
+ rotate: 180deg;
2536
+ } */
2537
+
2538
+ & > .content {
2539
+ margin-block-start: 0;
2540
+ padding-block: var(--size-2) var(--size-3);
2541
+ }
2542
+
2543
+ & > .actions {
2544
+ display: flex;
2545
+ gap: var(--size-1);
2546
+ justify-content: end;
2547
+ margin-block-start: var(--size-3);
2548
+ padding-block-end: var(--size-1);
2549
+ padding-inline: var(--size-3) var(--size-1);
2550
+ }
2551
+
2552
+ /* Variants */
2553
+ &.card,
2554
+ &.text {
2555
+ --_bg-color: transparent;
2556
+ --_margin-inline: var(--size-1);
2557
+ }
2558
+
2559
+ &.elevated {
2560
+ --_bg-color: var(--surface-elevated);
2561
+ --_margin-inline: 0;
2562
+ --_shadow: var(--shadow-2);
2563
+ }
2564
+
2565
+ &.outlined {
2566
+ --_bg-color: var(--surface-default);
2567
+ --_margin-inline: 0;
2568
+ border: 1px solid var(--border-color);
2569
+ }
2570
+
2571
+ &.tonal {
2572
+ --_bg-color: var(--surface-tonal);
2573
+ --_margin-inline: 0;
2574
+ }
2575
+
2576
+ &:where(.elevated, .outlined, .tonal) > * {
2577
+ padding-inline: var(--size-3);
2578
+ }
2579
+ }
2580
+
2581
+ /* Accordion group */
2582
+ :where(.card:has(details)) {
2583
+ --_gutter-color: var(--border-color);
2584
+
2585
+ display: block;
2586
+
2587
+ & > .content {
2588
+ margin-block: 0;
2589
+ padding: 0;
2590
+ }
2591
+
2592
+ &.card,
2593
+ &.text {
2594
+ &:not(.tonal, .outlined, .elevated) {
2595
+ summary {
2596
+ padding-inline: 0;
2597
+ }
2598
+ }
2599
+ }
2600
+
2601
+ details {
2602
+ --_margin-inline: 0;
2603
+
2604
+ border: 0;
2605
+ box-shadow: none;
2606
+
2607
+ & > * {
2608
+ padding-inline: var(--size-3);
2609
+ }
2610
+
2611
+ /* Border between accordion items */
2612
+ & + & {
2613
+ summary {
2614
+ border-radius: 0;
2615
+ border-block-start: 1px solid var(--_gutter-color);
2616
+ }
2617
+ }
2618
+
2619
+ /* First item */
2620
+ &:first-of-type {
2621
+ border-start-start-radius: var(--border-radius, 0.25rem);
2622
+ border-start-end-radius: var(--border-radius, 0.25rem);
2623
+ summary {
2624
+ border-start-start-radius: var(--border-radius, 0.25rem);
2625
+ border-start-end-radius: var(--border-radius, 0.25rem);
2626
+ }
2627
+ }
2628
+
2629
+ /* Last item */
2630
+ &:last-of-type {
2631
+ border-end-start-radius: var(--border-radius, 0.25rem);
2632
+ border-end-end-radius: var(--border-radius, 0.25rem);
2633
+ summary {
2634
+ border-end-start-radius: var(--border-radius, 0.25rem);
2635
+ border-end-end-radius: var(--border-radius, 0.25rem);
2636
+ }
2637
+ }
2638
+ }
2639
+ }
2640
+ }
2641
+
2642
+ @layer components.extended {
2643
+ /*
2644
+ Lists meant to be used stand-alone or as part of Select elements
2645
+
2646
+ Intended use-case:
2647
+ - ul.list > li
2648
+ - .select > .list > option
2649
+ */
2650
+ :where(.list) {
2651
+ --_bg-color: light-dark(var(--gray-1), var(--gray-15));
2652
+ --_bg-color-hover: light-dark(var(--gray-2), var(--gray-14));
2653
+
2654
+ background-color: var(--_bg-color);
2655
+ list-style: none;
2656
+ padding: var(--size-2) 0;
2657
+
2658
+ @media (pointer: coarse) {
2659
+ &,
2660
+ * {
2661
+ user-select: none;
2662
+ }
2663
+ }
2664
+
2665
+ /* Borders on all list items */
2666
+ &.bordered {
2667
+ :where(li + li, option + option) {
2668
+ margin-block-start: var(--size-3);
2669
+ &::before {
2670
+ block-size: 1px;
2671
+ border-block-start: 1px solid var(--border-color);
2672
+ content: "";
2673
+ display: block;
2674
+ inline-size: 100%;
2675
+ inset: calc(-1 * var(--size-2)) 0 auto 0;
2676
+ position: absolute;
2677
+ visibility: visible; /* override select > option:before style */
2678
+ }
2679
+ }
2680
+ }
2681
+
2682
+ /* Dense - less gaps and spacing */
2683
+ &.dense {
2684
+ :where(li, option) {
2685
+ gap: var(--size-2);
2686
+ min-block-size: var(--size-7);
2687
+ padding: var(--size-1) var(--size-2);
2688
+
2689
+ &.border-top {
2690
+ margin-block-start: var(--size-2);
2691
+ &::before {
2692
+ inset: calc(-1 * var(--size-1)) 0 auto 0;
2693
+ }
2694
+ }
2695
+
2696
+ /* Clickable list item */
2697
+ &:has(> a, > button, > label) {
2698
+ min-block-size: auto;
2699
+ padding: 0;
2700
+ }
2701
+
2702
+ & > :where(a, button, label) {
2703
+ gap: var(--size-2);
2704
+ min-block-size: var(--size-7);
2705
+ padding: var(--size-1) var(--size-2);
2706
+ }
2707
+
2708
+ /* Checkbox / Radio */
2709
+ & > label {
2710
+ .end {
2711
+ padding-inline-end: 0.125rem;
2712
+ }
2713
+ }
2714
+
2715
+ /* Leading and trailing content */
2716
+ .start,
2717
+ .end {
2718
+ .avatar {
2719
+ max-inline-size: var(--size-6);
2720
+ }
2721
+
2722
+ .icon-button,
2723
+ svg {
2724
+ max-inline-size: var(--size-4);
2725
+ }
2726
+
2727
+ .checkbox,
2728
+ .radio {
2729
+ max-inline-size: var(--size-3);
2730
+ }
2731
+ }
2732
+ }
2733
+ }
2734
+
2735
+ /* Gutterless */
2736
+ &.gutterless {
2737
+ :where(li, option) {
2738
+ padding-inline: 0;
2739
+
2740
+ & > :where(a, button, label) {
2741
+ padding-inline: 0;
2742
+ }
2743
+ }
2744
+ }
2745
+
2746
+ /* List item */
2747
+ :where(li, option, [role="group"] > label) {
2748
+ align-items: center;
2749
+ background: var(--_bg-color) var(--ripple, none);
2750
+ display: flex;
2751
+ font-size: var(--font-size-sm);
2752
+ gap: var(--size-3);
2753
+ isolation: isolate;
2754
+ min-block-size: 40px;
2755
+ padding: var(--size-2) var(--size-3);
2756
+ position: relative;
2757
+
2758
+ &::before {
2759
+ display: none; /* removing checkmark from option */
2760
+ }
2761
+
2762
+ * {
2763
+ font-size: inherit;
2764
+ }
2765
+
2766
+ /* Clickable list item */
2767
+ &:has(> a, > button, > label) {
2768
+ background: transparent;
2769
+ display: block;
2770
+ min-block-size: auto;
2771
+ padding: 0;
2772
+ }
2773
+
2774
+ /* Select option */
2775
+ &:where(option) {
2776
+ align-items: center;
2777
+ background-color: var(--_bg-color);
2778
+ color: inherit;
2779
+ cursor: pointer;
2780
+ display: flex;
2781
+ gap: var(--size-3);
2782
+ inline-size: 100%;
2783
+ margin: 0;
2784
+ min-block-size: 40px;
2785
+ padding: var(--size-2) var(--size-3);
2786
+ text-align: start;
2787
+ text-decoration: none;
2788
+ z-index: 0;
2789
+
2790
+ &:hover {
2791
+ background-color: var(--_bg-color-hover);
2792
+ }
2793
+
2794
+ &:checked {
2795
+ background-color: oklch(from var(--primary) l c h / 30%);
2796
+ }
2797
+ }
2798
+
2799
+ & > a,
2800
+ & > button,
2801
+ & > label {
2802
+ align-items: center;
2803
+ background: var(--_bg-color) var(--ripple, none);
2804
+ color: inherit;
2805
+ cursor: pointer;
2806
+ display: flex;
2807
+ gap: var(--size-3);
2808
+ inline-size: 100%;
2809
+ margin: 0;
2810
+ min-block-size: 40px;
2811
+ outline-offset: -3px;
2812
+ padding: var(--size-2) var(--size-3);
2813
+ text-align: start;
2814
+ text-decoration: none;
2815
+ z-index: 0;
2816
+
2817
+ /*** Ripple effect */
2818
+ background-position: center;
2819
+ transition: background var(--button-ripple-duration);
2820
+ &:where(:not(:active):hover) {
2821
+ --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%)
2822
+ center/15000%;
2823
+ }
2824
+
2825
+ &:where(:hover:active) {
2826
+ background-size: var(--button-ripple-size);
2827
+ transition: background 0s;
2828
+ }
2829
+
2830
+ &:hover {
2831
+ background-color: var(--_bg-color-hover);
2832
+ }
2833
+
2834
+ /*** Remove ripple effect when trailing button is clicked */
2835
+ &:has(.end:hover) {
2836
+ &:where(:not(:active):hover) {
2837
+ --ripple: none;
2838
+ }
2839
+ }
2840
+ }
2841
+
2842
+ /* Checkbox / Radio / Switch */
2843
+ & > label {
2844
+ .end {
2845
+ padding-inline-end: var(--size-1);
2846
+ }
2847
+
2848
+ &:where(.checkbox, .radio) {
2849
+ inline-size: 100%;
2850
+ }
2851
+
2852
+ &.switch {
2853
+ --_dot-size: 0.75rem;
2854
+ --_track-height: var(--size-4);
2855
+ --_track-width: 2.5rem;
2856
+ }
2857
+ }
2858
+
2859
+ /* Video */
2860
+ &:has(video) {
2861
+ padding: 0.75rem var(--size-3) 0.75rem 0;
2862
+ }
2863
+
2864
+ /* Border between list items */
2865
+ &.border-top {
2866
+ margin-block-start: var(--size-3);
2867
+ &::before {
2868
+ block-size: 1px;
2869
+ border-block-start: 1px solid var(--border-color);
2870
+ content: "";
2871
+ display: block;
2872
+ inline-size: 100%;
2873
+ inset: calc(-1 * var(--size-2)) 0 auto 0;
2874
+ position: absolute;
2875
+ }
2876
+ }
2877
+
2878
+ /* Text */
2879
+ .text {
2880
+ flex: 1;
2881
+ line-height: 1.6;
2882
+
2883
+ :where(h1, h2, h3, h4, h5, h6, p, span) {
2884
+ color: inherit;
2885
+ font-weight: 400;
2886
+ }
2887
+
2888
+ p + p {
2889
+ font-size: var(--font-size-xs);
2890
+ }
2891
+ }
2892
+
2893
+ /* Leading content */
2894
+ .start {
2895
+ align-self: center;
2896
+ align-items: center;
2897
+ display: grid;
2898
+ z-index: 1;
2899
+
2900
+ &:has(svg) {
2901
+ max-inline-size: var(--size-5);
2902
+ }
2903
+
2904
+ svg {
2905
+ padding-block-start: 0.125rem;
2906
+ }
2907
+
2908
+ img {
2909
+ aspect-ratio: 1;
2910
+ inline-size: 56px;
2911
+ object-fit: cover;
2912
+ }
2913
+
2914
+ video {
2915
+ aspect-ratio: 16/9;
2916
+ block-size: 64px;
2917
+ object-fit: cover;
2918
+ }
2919
+ }
2920
+
2921
+ /* Trailing content */
2922
+ .end {
2923
+ align-items: center;
2924
+ display: flex;
2925
+ font-size: var(--font-size-xs);
2926
+ text-align: end;
2927
+ z-index: 1;
2928
+
2929
+ &:not(:has(a, button, input)) {
2930
+ pointer-events: none;
2931
+ }
2932
+
2933
+ kbd {
2934
+ background-color: transparent;
2935
+ border: 0;
2936
+ color: inherit;
2937
+ opacity: 0.6;
2938
+ }
2939
+
2940
+ svg {
2941
+ max-inline-size: var(--size-5);
2942
+ inline-size: 100%;
2943
+ }
2944
+ }
2945
+
2946
+ /* Inset */
2947
+ &.inset {
2948
+ .text {
2949
+ padding-inline-start: calc(var(--size-5) + var(--size-3));
2950
+ }
2951
+
2952
+ /* Safety measure so it won't look bad if there for some reason should exist a leading element inside. */
2953
+ .start {
2954
+ display: none;
2955
+ }
2956
+ }
2957
+ }
2958
+ }
2959
+ }
2960
+
2961
+ @layer components.extended {
2962
+ :where(.alert) {
2963
+ --_bg-color: var(--surface-tonal);
2964
+ --_border-color: var(--surface-tonal);
2965
+ --_color: var(--text-color-1);
2966
+
2967
+ &.outlined {
2968
+ --_bg-color: var(--surface-default);
2969
+ --_border-color: var(--border-color);
2970
+ --_color: var(--text-color-1);
2971
+ }
2972
+
2973
+ background-color: var(--_bg-color);
2974
+ border: 1px solid var(--_border-color);
2975
+ border-radius: var(--border-radius);
2976
+ color: var(--_color);
2977
+ padding: var(--size-3);
2978
+
2979
+ & > .content {
2980
+ display: grid;
2981
+ gap: var(--size-2);
2982
+ font-size: var(--font-size-sm);
2983
+
2984
+ h1,
2985
+ h2,
2986
+ h3,
2987
+ h4,
2988
+ h5,
2989
+ h6 {
2990
+ color: inherit;
2991
+ font-size: var(--font-size-md);
2992
+ font-weight: 600;
2993
+
2994
+ * {
2995
+ font-size: inherit;
2996
+ }
2997
+ }
2998
+ }
2999
+
3000
+ /* Colors */
3001
+ &.error,
3002
+ &.ok,
3003
+ &.warning {
3004
+ --_bg-color: var(--color-4);
3005
+ --_border-color: var(--color-9);
3006
+ --_color: var(--color-15);
3007
+
3008
+ &.outlined {
3009
+ --_bg-color: var(--surface-default);
3010
+ --_border-color: var(--color-9);
3011
+ --_color: light-dark(var(--color-15), var(--color-1));
3012
+ }
3013
+
3014
+ svg {
3015
+ margin-block-start: 0.15rem;
3016
+ stroke: var(--color-9);
3017
+ }
3018
+ }
3019
+
3020
+ /* Links
3021
+ * Can't make sure contrast will be acceptable (yet) so we use the current text color instead.
3022
+ */
3023
+ &:not(.outlined) {
3024
+ a[href] {
3025
+ color: inherit;
3026
+
3027
+ &:hover {
3028
+ color: var(--primary);
3029
+ }
3030
+ }
3031
+ }
3032
+
3033
+ /* Icon */
3034
+ &:has(svg) {
3035
+ display: grid;
3036
+ gap: var(--size-3);
3037
+ grid-template-columns: var(--size-4) 1fr;
3038
+
3039
+ svg {
3040
+ margin-block-start: 0.15rem;
3041
+ stroke: currentColor;
3042
+ }
3043
+ }
3044
+ }
3045
+ }
3046
+
3047
+ @layer components.extended {
3048
+ :where(dialog) {
3049
+ margin-block-start: 15%; /* vertical alignment */
3050
+ padding-block: 0;
3051
+ pointer-events: none;
3052
+
3053
+ &::backdrop {
3054
+ background-color: rgba(0, 0, 0, 0.5);
3055
+ backdrop-filter: blur(5px);
3056
+
3057
+ @media (prefers-reduced-motion: reduce) {
3058
+ backdrop-filter: none;
3059
+ }
3060
+ }
3061
+
3062
+ &:not([open]) {
3063
+ display: none;
3064
+ }
3065
+
3066
+ &[open] {
3067
+ pointer-events: all;
3068
+ }
3069
+
3070
+ .actions {
3071
+ justify-content: end;
3072
+ padding-inline: var(--size-3) var(--size-1);
3073
+ }
3074
+
3075
+ /* Animation */
3076
+ /* There's no close animation, intentionally */
3077
+ opacity: 0;
3078
+
3079
+ &[open] {
3080
+ opacity: 1;
3081
+ transition: display 0.2s allow-discrete,
3082
+ margin-block-start 0.3s var(--ease-1), overlay 0.2s allow-discrete,
3083
+ opacity 0.2s var(--ease-out-1);
3084
+
3085
+ @starting-style {
3086
+ opacity: 0;
3087
+ }
3088
+ }
3089
+
3090
+ @media (prefers-reduced-motion: no-preference) {
3091
+ margin-block-start: 17%;
3092
+ &[open] {
3093
+ margin-block-start: 15%;
3094
+
3095
+ @starting-style {
3096
+ margin-block-start: 17%;
3097
+ }
3098
+ }
3099
+ }
3100
+ }
3101
+
3102
+ :where(html:has(dialog[open])) {
3103
+ overflow: hidden;
3104
+ }
3105
+ }
3106
+
3107
+ @layer components.extended {
3108
+ :where(.snackbar) {
3109
+ align-items: center;
3110
+ /* Inverse surface-filled */
3111
+ background-color: light-dark(var(--gray-15), var(--gray-2));
3112
+ border-radius: var(--border-radius);
3113
+ box-shadow: var(--shadow-2);
3114
+ color: var(--text-color-1-contrast);
3115
+ display: flex;
3116
+ font-size: var(--font-size-sm);
3117
+ gap: var(--size-3);
3118
+ inset-block: auto var(--size-3);
3119
+ inset-inline: var(--size-3) auto;
3120
+ justify-content: space-between;
3121
+ min-inline-size: min(100%, 37ch);
3122
+ padding: var(--size-2) var(--size-3);
3123
+ position: fixed;
3124
+ inline-size: calc(100% - var(--size-6, 1.75rem));
3125
+ z-index: 100;
3126
+
3127
+ &::backdrop {
3128
+ display: none;
3129
+ }
3130
+
3131
+ * {
3132
+ word-break: break-word;
3133
+ }
3134
+
3135
+ /* Global positioning (in relation to the window) */
3136
+ /*** Default (end-start) */
3137
+ inset-block: auto var(--size-3);
3138
+ inset-inline: 50% 0;
3139
+ translate: -50% 0;
3140
+
3141
+ &.start-start,
3142
+ &.start-center,
3143
+ &.start-end {
3144
+ inset-block: var(--size-3) auto;
3145
+ }
3146
+
3147
+ /* TODO use @custom-media instead? */
3148
+ @container (width > 480px) {
3149
+ /* Default (end-start) */
3150
+ inset-block: auto var(--size-7, 2rem);
3151
+ inset-inline: var(--size-7, 2rem) auto;
3152
+ translate: revert;
3153
+ inline-size: fit-content;
3154
+
3155
+ &.end-start,
3156
+ &.end-end,
3157
+ &.start-start,
3158
+ &.start-end {
3159
+ translate: revert;
3160
+ }
3161
+
3162
+ &.start-start {
3163
+ inset-block: var(--size-7, 2rem) auto;
3164
+ inset-inline: var(--size-7, 2rem) auto;
3165
+ }
3166
+ &.start-center {
3167
+ inset-block: var(--size-7, 2rem) auto;
3168
+ inset-inline: 50% 0;
3169
+ translate: -50% 0;
3170
+ }
3171
+ &.start-end {
3172
+ inset-block: var(--size-7, 2rem) auto;
3173
+ inset-inline: auto var(--size-7, 2rem);
3174
+ }
3175
+ &.end-start {
3176
+ inset-block-end: var(--size-7, 2rem);
3177
+ inset-inline: var(--size-7, 2rem) auto;
3178
+ }
3179
+ &.end-center {
3180
+ inset-block: auto var(--size-7, 2rem);
3181
+ inset-inline: 50% 0;
3182
+ translate: -50% 0;
3183
+ }
3184
+ &.end-end {
3185
+ inset-block: auto var(--size-7, 2rem);
3186
+ inset-inline: auto var(--size-7, 2rem);
3187
+ }
3188
+ }
3189
+
3190
+ /* Absolute positioning */
3191
+ &.absolute {
3192
+ position: absolute;
3193
+ }
3194
+
3195
+ /* Actions */
3196
+ .actions {
3197
+ align-items: center;
3198
+ display: flex;
3199
+ flex-shrink: 0;
3200
+ gap: var(--size-3);
3201
+ padding-inline: 0;
3202
+
3203
+ button {
3204
+ /* Inverse hover and active backgrounds */
3205
+ &:where(:not([disabled])) {
3206
+ &:where(:not(:active):hover) {
3207
+ --_bg-color: light-dark(
3208
+ color-mix(in oklch, white 40%, black),
3209
+ color-mix(in oklch, white 85%, black)
3210
+ );
3211
+ }
3212
+
3213
+ &:where(:hover:active) {
3214
+ --_bg-color: light-dark(
3215
+ color-mix(in oklch, white 45%, black),
3216
+ color-mix(in oklch, white 80%, black)
3217
+ );
3218
+ }
3219
+ }
3220
+ }
3221
+
3222
+ button:not(:has(svg)) {
3223
+ border-radius: var(--border-radius);
3224
+ font-size: inherit;
3225
+ max-block-size: var(--size-6, 1.5rem);
3226
+ padding: 1ex;
3227
+ }
3228
+
3229
+ button:has(svg) {
3230
+ color: inherit;
3231
+ max-inline-size: var(--size-6, 1.75rem);
3232
+ margin: var(--size-00);
3233
+ padding: var(--size-1);
3234
+ }
3235
+ }
3236
+
3237
+ /* Animations */
3238
+ opacity: 0;
3239
+ transition: display 0.075s allow-discrete, overlay 0.075s allow-discrete,
3240
+ opacity 0.075s var(--ease-out-1);
3241
+
3242
+ &:popover-open,
3243
+ &:popover-open::backdrop,
3244
+ &.visible {
3245
+ opacity: 1;
3246
+ transition: display 0.25s allow-discrete, overlay 0.25s allow-discrete,
3247
+ opacity 0.25s var(--ease-out-1);
3248
+
3249
+ @starting-style {
3250
+ opacity: 0;
3251
+ }
3252
+ }
3253
+ }
3254
+ }
3255
+
3256
+ @layer components.extended {
3257
+ /* Common styling for checkbox, radio and switch groups */
3258
+ :where(fieldset.field-group) {
3259
+ border: 0;
3260
+ border-radius: 0;
3261
+ gap: 0;
3262
+ padding: 0;
3263
+ z-index: 1;
3264
+
3265
+ legend {
3266
+ color: var(--text-color-2);
3267
+ padding: 0 1ex 0 0;
3268
+ }
3269
+
3270
+ /* Disabled */
3271
+ &[disabled] {
3272
+ cursor: not-allowed;
3273
+ opacity: 0.64;
3274
+ user-select: none;
3275
+
3276
+ input {
3277
+ cursor: not-allowed;
3278
+ }
3279
+ }
3280
+
3281
+ /* Validation */
3282
+ &.error {
3283
+ legend,
3284
+ .supporting-text {
3285
+ color: var(--color-9);
3286
+ }
3287
+ }
3288
+
3289
+ /* Required */
3290
+ &:has([required]) {
3291
+ &:not(:has(input:where([type="radio"], [type="checkbox"]):checked)) {
3292
+ legend {
3293
+ position: relative;
3294
+
3295
+ &::after {
3296
+ color: var(--red);
3297
+ content: "*";
3298
+ inset: 0 -0.25ex auto auto;
3299
+ position: absolute;
3300
+ }
3301
+ }
3302
+ }
3303
+ }
3304
+ :where(.radio, .checkbox, .switch) .label:after {
3305
+ display: none;
3306
+ }
3307
+
3308
+ /* Supporting text */
3309
+ .supporting-text {
3310
+ color: var(--text-color-2);
3311
+ font-size: var(--font-size-xs);
3312
+ line-height: 1.5;
3313
+ z-index: 1;
3314
+ }
3315
+
3316
+ /* Fields */
3317
+ .fields {
3318
+ display: flex;
3319
+ flex-direction: column;
3320
+ gap: var(--size-2);
3321
+
3322
+ * ~ & {
3323
+ padding: var(--size-2) 0;
3324
+ }
3325
+ }
3326
+
3327
+ :last-child {
3328
+ padding-block-end: 0;
3329
+ }
3330
+
3331
+ /* Directions */
3332
+ &.row {
3333
+ .fields {
3334
+ flex-direction: row;
3335
+ }
3336
+ }
3337
+ }
3338
+ }
3339
+
3340
+ @layer components.extended {
3341
+ /*
3342
+ - Common styling for input, textarea and select
3343
+ - Form related styles such as: label, supporting text, error handling
3344
+ */
3345
+ :where(.field) {
3346
+ --_accent-color: var(--primary);
3347
+ --_bg-color: var(--surface-default);
3348
+ --_border-color: var(--field-border-color);
3349
+ --_field-padding-block: 0.75rem;
3350
+ --_field-padding-inline: var(--size-2);
3351
+ --_filled-border-color: var(--text-color-1);
3352
+ --_height: var(--field-size);
3353
+ --_label-color: var(--text-color-2);
3354
+ --_supporting-text-color: var(--text-color-2);
3355
+
3356
+ display: grid;
3357
+ position: relative;
3358
+
3359
+ /* Input/Select base */
3360
+ :where(& input, & textarea, & select) {
3361
+ background-color: var(--_bg-color);
3362
+ block-size: var(--_height);
3363
+ border-radius: var(--field-border-radius);
3364
+ border: var(--field-border-width) solid var(--_border-color);
3365
+ color: var(--text-color-1);
3366
+ font-family: var(--font-sans);
3367
+ font-size: var(--font-size-1);
3368
+ grid-column: 1/-1;
3369
+ grid-row: 2;
3370
+ inline-size: 100%;
3371
+ line-height: var(--font-lineheight-1);
3372
+ min-inline-size: 0;
3373
+ padding: var(--_field-padding-block) var(--_field-padding-inline);
3374
+
3375
+ @media (prefers-reduced-motion: no-preference) {
3376
+ transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
3377
+ padding-block 0.2s var(--ease-3);
3378
+ }
3379
+ }
3380
+
3381
+ /* Required/Invalid */
3382
+ &:has(
3383
+ :not(:placeholder-shown):invalid,
3384
+ :where(
3385
+ :placeholder-shown,
3386
+ option[value=""]:not(:checked),
3387
+ option:checked:not([value=""])
3388
+ ):required
3389
+ ) {
3390
+ .label:after {
3391
+ color: var(--red);
3392
+ content: "*";
3393
+ margin: -0.25em auto auto 0.25em;
3394
+ }
3395
+ }
3396
+
3397
+ /* File */
3398
+ &:has(input[type="file"]) {
3399
+ cursor: pointer;
3400
+
3401
+ input {
3402
+ align-self: flex-start;
3403
+ block-size: var(--_height);
3404
+ box-shadow: none;
3405
+ color: var(--text-color-1);
3406
+ cursor: inherit;
3407
+ max-inline-size: 100%;
3408
+ padding: 0;
3409
+ transition: font-size 0.2s var(--ease-3);
3410
+
3411
+ &::-webkit-file-upload-button,
3412
+ &::file-selector-button {
3413
+ background-color: var(--surface-tonal);
3414
+ border: none;
3415
+ block-size: calc(100% - var(--size-2) * 2);
3416
+ border-radius: var(--field-border-radius);
3417
+ cursor: pointer;
3418
+ margin-inline-end: 1ex;
3419
+ margin-block-start: var(--size-2);
3420
+ margin-inline-start: var(--size-2);
3421
+ }
3422
+ }
3423
+
3424
+ /* Variants */
3425
+ &.filled {
3426
+ input {
3427
+ &::-webkit-file-upload-button,
3428
+ &::file-selector-button {
3429
+ background-color: var(--surface-default);
3430
+ block-size: calc(100% - var(--size-2) * 2);
3431
+ border-radius: var(--field-border-radius);
3432
+ cursor: pointer;
3433
+ margin-block-start: var(--size-2);
3434
+ }
3435
+ }
3436
+ }
3437
+
3438
+ /* Sizes */
3439
+ &.small {
3440
+ input {
3441
+ font-size: var(--font-size-sm);
3442
+ &::-webkit-file-upload-button,
3443
+ &::file-selector-button {
3444
+ block-size: calc(100% - var(--size-2));
3445
+ margin-block-start: var(--size-1);
3446
+ }
3447
+ }
3448
+ }
3449
+ }
3450
+
3451
+ /* Autosuggest */
3452
+ &:has(input[list]) {
3453
+ .label {
3454
+ /* Make sure chevron is visible */
3455
+ inline-size: calc(100% - var(--size-6));
3456
+ }
3457
+ }
3458
+
3459
+ /* Select */
3460
+ &:has(select) {
3461
+ .label {
3462
+ /* Make sure chevron is visible */
3463
+ inline-size: calc(100% - var(--size-6));
3464
+ }
3465
+ }
3466
+
3467
+ /* Experimental Select */
3468
+ &:has(select button) {
3469
+ select {
3470
+ padding: 0;
3471
+
3472
+ button {
3473
+ outline: 0;
3474
+ padding: var(--_field-padding-block) var(--size-8)
3475
+ var(--_field-padding-block) var(--_field-padding-inline);
3476
+ }
3477
+ }
3478
+ }
3479
+
3480
+ /* Non-experimental Select */
3481
+ &:has(select):not(:has(button)) {
3482
+ select {
3483
+ padding: var(--_field-padding-block) var(--size-8)
3484
+ var(--_field-padding-block) var(--_field-padding-inline);
3485
+ }
3486
+ }
3487
+
3488
+ /* Input - color */
3489
+ &:has(input[type="color"]) {
3490
+ input {
3491
+ appearance: none;
3492
+ background: none;
3493
+ block-size: var(--_height);
3494
+ inline-size: var(--_height);
3495
+ overflow: hidden;
3496
+ padding: 0;
3497
+
3498
+ &::-webkit-color-swatch {
3499
+ border: none;
3500
+ }
3501
+
3502
+ &::-webkit-color-swatch-wrapper {
3503
+ padding: 0;
3504
+ }
3505
+ }
3506
+ }
3507
+
3508
+ /* Element states */
3509
+ &:hover {
3510
+ &:not(.error) {
3511
+ :where(input, textarea, select) {
3512
+ --_border-color: var(--text-color-1);
3513
+ }
3514
+ }
3515
+ }
3516
+
3517
+ &:focus-within {
3518
+ & input,
3519
+ & textarea,
3520
+ & select {
3521
+ border-color: var(--_accent-color);
3522
+ outline-offset: -2px;
3523
+ outline: 2px solid var(--_accent-color);
3524
+ }
3525
+ }
3526
+
3527
+ /* Label */
3528
+ .label {
3529
+ font-size: var(--font-size-sm);
3530
+ grid-column: 1/-1;
3531
+ grid-row: 1;
3532
+ }
3533
+
3534
+ /* Supporting text */
3535
+ .supporting-text {
3536
+ color: var(--_supporting-text-color);
3537
+ font-size: var(--font-size-xs);
3538
+ grid-column: 1/-1;
3539
+ grid-row: 3;
3540
+ line-height: 1.5;
3541
+ }
3542
+
3543
+ /* Auto-fit */
3544
+ &.auto-fit {
3545
+ inline-size: auto;
3546
+
3547
+ :where(& input, & textarea) {
3548
+ field-sizing: content;
3549
+ inline-size: auto;
3550
+ }
3551
+ }
3552
+
3553
+ /* Validation */
3554
+ &.error {
3555
+ --_accent-color: var(--color-9);
3556
+ --_border-color: var(--color-9);
3557
+ --_filled-border-color: var(--color-9);
3558
+ --_label-color: var(--color-9);
3559
+ --_supporting-text-color: var(--color-9);
3560
+ }
3561
+
3562
+ /*
3563
+ * Variant: Filled
3564
+ */
3565
+ &.filled {
3566
+ --_bg-color: var(--surface-tonal);
3567
+
3568
+ &:not(:has([disabled], :has(input[type="color"]))) {
3569
+ /* Hover */
3570
+ &:hover {
3571
+ --_bg-color: light-dark(
3572
+ oklch(from var(--surface-tonal) calc(l * 0.93) c h),
3573
+ oklch(from var(--surface-tonal) calc(l * 1.1) c h)
3574
+ );
3575
+ }
3576
+ }
3577
+ }
3578
+
3579
+ /* Disabled */
3580
+ &:where(:has([disabled])) {
3581
+ &::before {
3582
+ display: none;
3583
+ }
3584
+ :where(input, textarea, select) {
3585
+ cursor: not-allowed;
3586
+ opacity: 0.7;
3587
+
3588
+ * {
3589
+ pointer-events: none;
3590
+ }
3591
+ }
3592
+ }
3593
+
3594
+ /* Read-only */
3595
+ &:where(:has([readonly])) {
3596
+ &::before {
3597
+ display: none;
3598
+ }
3599
+ :where(input, textarea, select) {
3600
+ cursor: not-allowed;
3601
+
3602
+ * {
3603
+ pointer-events: none;
3604
+ }
3605
+ }
3606
+ }
3607
+
3608
+ /* Sizes */
3609
+ &.small {
3610
+ --_field-padding-block: var(--size-2);
3611
+ --_height: var(--field-size-small);
3612
+
3613
+ &:has(input[type="color"]) {
3614
+ .label {
3615
+ line-height: 1.5;
3616
+ }
3617
+ }
3618
+ }
3619
+ }
3620
+ }
3621
+
3622
+ @layer components.extended {
3623
+ :where(.field > select) {
3624
+ position: relative;
3625
+
3626
+ /* Default arrow */
3627
+ &::picker-icon {
3628
+ block-size: 0;
3629
+ border-block-start: 5px solid;
3630
+ border-inline: 5px solid transparent;
3631
+ color: currentColor;
3632
+ content: "";
3633
+ inline-size: 0;
3634
+ inset: 50% var(--size-3) auto auto;
3635
+ pointer-events: none;
3636
+ position: absolute;
3637
+ translate: 0 -50%;
3638
+ }
3639
+
3640
+ &:open {
3641
+ &::picker-icon {
3642
+ rotate: 180deg;
3643
+ }
3644
+ }
3645
+
3646
+ /* Select popover */
3647
+ &::picker(select) {
3648
+ /* Animation on-stage styles */
3649
+ border: 0;
3650
+ box-shadow: var(--shadow-2);
3651
+ opacity: 1;
3652
+ padding: 0;
3653
+ scale: 1;
3654
+
3655
+ /* Animation starting styles */
3656
+ @starting-style {
3657
+ opacity: 0;
3658
+ transform: scale(0.9);
3659
+ }
3660
+
3661
+ @media (prefers-reduced-motion: no-preference) {
3662
+ transition: display 0.2s allow-discrete, opacity 0.2s var(--ease-3),
3663
+ overlay 0.2s allow-discrete, scale 0.2s var(--ease-3);
3664
+ }
3665
+ }
3666
+
3667
+ /* Animation off-stage styles */
3668
+ &:not(:open)::picker(select) {
3669
+ opacity: 0;
3670
+ scale: 0.9;
3671
+ }
3672
+
3673
+ button {
3674
+ background-color: transparent;
3675
+ display: flex;
3676
+ inline-size: 100%;
3677
+ margin: 0;
3678
+ position: relative;
3679
+
3680
+ selectedcontent {
3681
+ overflow: hidden;
3682
+ text-overflow: ellipsis;
3683
+ white-space: nowrap;
3684
+ }
3685
+ }
3686
+
3687
+ .list {
3688
+ /* Groups */
3689
+ [role="group"] {
3690
+ label {
3691
+ background-color: light-dark(var(--gray-3), var(--gray-13));
3692
+ color: light-dark(
3693
+ oklch(from var(--text-color-1) calc(l * 0.75) c h),
3694
+ oklch(from var(--text-color-1) calc(l * 1.25) c h)
3695
+ );
3696
+ font-weight: 500;
3697
+ overflow: hidden;
3698
+ padding-inline: var(--size-2);
3699
+ text-overflow: ellipsis;
3700
+ white-space: nowrap;
3701
+ }
3702
+
3703
+ &:not(:first-child),
3704
+ option:first-of-type {
3705
+ margin-block-start: var(--size-2);
3706
+ }
3707
+
3708
+ option:last-of-type,
3709
+ &:last-child {
3710
+ option:last-of-type {
3711
+ margin-block-end: 0;
3712
+ }
3713
+ }
3714
+ }
3715
+
3716
+ /* Option */
3717
+ option {
3718
+ /* Checkmark */
3719
+ /* TODO - checkmark should be the final version of the checkmark API. Follow the development of this and remove redundant psuedo stuff. */
3720
+ &::check {
3721
+ display: none;
3722
+ }
3723
+ &::checkmark {
3724
+ display: none;
3725
+ }
3726
+ &::before {
3727
+ display: none;
3728
+ }
3729
+
3730
+ &:focus-visible {
3731
+ outline-offset: -1px;
3732
+ }
3733
+ }
3734
+ }
3735
+ }
3736
+
3737
+ :where(.field:has(> select)) {
3738
+ /* Size */
3739
+ &.small {
3740
+ button {
3741
+ padding-inline: var(--size-2) var(--size-7);
3742
+
3743
+ &::after {
3744
+ inset-inline-end: var(--size-2);
3745
+ }
3746
+ }
3747
+ }
3748
+
3749
+ /*
3750
+ * Non-experimental Select
3751
+ *
3752
+ * 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`.
3753
+ */
3754
+ &:not(:has(button)) {
3755
+ select {
3756
+ appearance: none;
3757
+ }
3758
+
3759
+ /* Arrow */
3760
+ &::after {
3761
+ align-self: center;
3762
+ block-size: 0;
3763
+ border-block-start: 5px solid;
3764
+ border-inline: 5px solid transparent;
3765
+ content: "";
3766
+ display: inline-block;
3767
+ flex-shrink: 0;
3768
+ grid-column: 1/-1;
3769
+ grid-row: 2;
3770
+ inline-size: 0;
3771
+ inset-inline-end: var(--size-3);
3772
+ justify-self: end;
3773
+ pointer-events: none;
3774
+ position: relative;
3775
+ }
3776
+ }
3777
+ }
3778
+
3779
+ select:has(button),
3780
+ ::picker(select) {
3781
+ appearance: base-select;
3782
+ }
3783
+ }
3784
+
3785
+ @layer components.extended {
3786
+ :where(
3787
+ .field:has(
3788
+ :where(
3789
+ input[type="date"],
3790
+ input[type="datetime-local"],
3791
+ input[type="email"],
3792
+ input[type="month"],
3793
+ input[type="number"],
3794
+ input[type="password"],
3795
+ input[type="search"],
3796
+ input[type="tel"],
3797
+ input[type="text"],
3798
+ input[type="time"],
3799
+ input[type="url"],
3800
+ input[type="week"]
3801
+ )
3802
+ )
3803
+ ) {
3804
+ /* Sizes */
3805
+ &.small {
3806
+ input {
3807
+ padding-inline: var(--size-2);
3808
+ }
3809
+ }
3810
+ }
3811
+
3812
+ /* Autosuggest */
3813
+ :where(.field:has(input[list])) {
3814
+ /* Hide native arrow */
3815
+ input::-webkit-calendar-picker-indicator {
3816
+ opacity: 0;
3817
+ position: absolute;
3818
+ cursor: pointer;
3819
+ pointer-events: none;
3820
+ }
3821
+ }
3822
+ :where(
3823
+ .field:has(input[list]:placeholder-shown),
3824
+ .field:has(input[list]):where(:focus-within, :hover)
3825
+ ) {
3826
+ /* Arrow */
3827
+ &::after {
3828
+ block-size: 0;
3829
+ border-block-start: 5px solid;
3830
+ border-inline: 5px solid transparent;
3831
+ content: "";
3832
+ display: inline-block;
3833
+ flex-shrink: 0;
3834
+ inline-size: 0;
3835
+ inset: 50% var(--size-3) auto auto;
3836
+ pointer-events: none;
3837
+ position: absolute;
3838
+ translate: 0 -50%;
3839
+ }
3840
+ }
3841
+ }
3842
+
3843
+ @layer components.extended {
3844
+ :where(.field:has(textarea)) {
3845
+ textarea {
3846
+ block-size: auto;
3847
+ field-sizing: content;
3848
+ min-block-size: 5rem;
3849
+ resize: vertical;
3850
+ }
3851
+
3852
+ /* Size */
3853
+ &.small {
3854
+ textarea {
3855
+ min-block-size: var(--_height);
3856
+ }
3857
+ }
3858
+
3859
+ /* Auto-fit */
3860
+ &.auto-fit {
3861
+ textarea {
3862
+ min-block-size: var(--_height);
3863
+ resize: both;
3864
+ }
3865
+ }
3866
+ }
3867
+ }
3868
+
3869
+ @layer components.extended {
3870
+ @scope (.rich-text) to (.not-rich-text) {
3871
+ a {
3872
+ color: var(--primary);
3873
+ cursor: pointer;
3874
+ font-size: inherit;
3875
+ font-weight: 700;
3876
+ line-height: inherit;
3877
+ text-decoration: underline;
3878
+ text-decoration-color: var(--primary);
3879
+ text-underline-offset: 2px;
3880
+
3881
+ &[href] {
3882
+ &:hover,
3883
+ &:focus-visible {
3884
+ color: var(--primary-light);
3885
+ }
3886
+ }
3887
+ }
3888
+
3889
+ /* Blockquote */
3890
+ blockquote {
3891
+ font-size: inherit;
3892
+ line-height: inherit;
3893
+ :first-child {
3894
+ margin-block-start: 0;
3895
+ }
3896
+
3897
+ :last-child {
3898
+ margin-block-end: 0;
3899
+ }
3900
+ }
3901
+
3902
+ /* Text */
3903
+ p {
3904
+ font-size: inherit;
3905
+ line-height: inherit;
3906
+ margin-block: 1.25em;
3907
+ }
3908
+
3909
+ :is(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
3910
+ color: var(--text-color-1);
3911
+
3912
+ & + *:not(&) {
3913
+ margin-block-start: 0;
3914
+ }
3915
+ }
3916
+
3917
+ h1,
3918
+ .h1 {
3919
+ font-size: var(--font-size-h1, var(--font-size-7));
3920
+ letter-spacing: -0.02em;
3921
+ line-height: 1.1111111;
3922
+ margin-block: 0 0.8888889em;
3923
+ }
3924
+
3925
+ h2,
3926
+ .h2 {
3927
+ font-size: var(--font-size-h2, var(--font-size-5, 2rem));
3928
+ letter-spacing: -0.02em;
3929
+ line-height: 1.3333333;
3930
+ margin-block: 2em 1em;
3931
+ }
3932
+
3933
+ h3,
3934
+ .h3 {
3935
+ font-size: var(--font-size-h3, var(--font-size-4, 1.5rem));
3936
+ letter-spacing: -0.01em;
3937
+ line-height: 1.6;
3938
+ margin-block: 1.6em 0.6em;
3939
+ }
3940
+
3941
+ h4,
3942
+ .h4 {
3943
+ font-size: var(--font-size-h4, var(--font-size-3, 1.25rem));
3944
+ letter-spacing: -0.01em;
3945
+ line-height: 1.5;
3946
+ margin-block: 1.5em 0.5em;
3947
+ }
3948
+
3949
+ h5,
3950
+ .h5 {
3951
+ font-size: var(--font-size-h5, var(--font-size-2, 1.1rem));
3952
+ line-height: 1;
3953
+ margin-block: 0 var(--size-1);
3954
+ }
3955
+
3956
+ h6,
3957
+ .h6 {
3958
+ font-size: var(--font-size-h6, var(--font-size-1, 1rem));
3959
+ line-height: 1;
3960
+ margin-block: 0 var(--size-1);
3961
+ }
3962
+
3963
+ /** Overline */
3964
+ :where(.overline, hgroup > :where(p, .p):first-of-type:first-child) {
3965
+ color: light-dark(
3966
+ oklch(from var(--text-color-2) calc(l * 1.25) c h),
3967
+ oklch(from var(--text-color-2) calc(l * 0.75) c h)
3968
+ );
3969
+ font-size: var(--font-size-xs);
3970
+ font-weight: 500;
3971
+ letter-spacing: 0.06em;
3972
+ line-height: 2.5;
3973
+ text-transform: uppercase;
3974
+ }
3975
+
3976
+ hgroup {
3977
+ & > p {
3978
+ margin: 0;
3979
+ }
3980
+
3981
+ & > :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
3982
+ margin-block-end: 0.4em;
3983
+ }
3984
+
3985
+ & + * {
3986
+ margin-block-start: 3em;
3987
+ }
3988
+
3989
+ /* The second p element */
3990
+ & > :where(p, .p):last-of-type:last-child:not(:first-child) {
3991
+ color: oklch(from currentColor l c h / 75%);
3992
+ font-size: var(--font-size-lg);
3993
+ line-height: 1.6;
3994
+ }
3995
+ }
3996
+
3997
+ /* Lists */
3998
+ ul:not([class]) {
3999
+ list-style-type: disc;
4000
+ }
4001
+
4002
+ ol:not([class]) {
4003
+ list-style-type: decimal;
4004
+ }
4005
+
4006
+ :where(ul, ol):not([class]) {
4007
+ display: grid;
4008
+ font-size: inherit;
4009
+ gap: 0.5em;
4010
+ line-height: inherit;
4011
+ margin-block-start: 1.25em;
4012
+ margin-block-end: 1.25em;
4013
+ padding-inline-start: 1.625em;
4014
+
4015
+ li {
4016
+ padding-inline-start: 0.375em;
4017
+ }
4018
+ }
4019
+
4020
+ /* Nested lists */
4021
+ :where(ul ul),
4022
+ :where(ul ol),
4023
+ :where(ol ul),
4024
+ :where(ol ol) {
4025
+ margin-block-start: 0.75em;
4026
+ margin-block-end: 0.75em;
4027
+ }
4028
+
4029
+ /* Description lists */
4030
+ :where(dl) {
4031
+ font-size: inherit;
4032
+ line-height: inherit;
4033
+ margin-block-start: 1.25em;
4034
+ margin-block-end: 1.25em;
4035
+
4036
+ dt {
4037
+ margin-block-start: 1.25em;
4038
+ }
4039
+
4040
+ dd {
4041
+ margin-block-start: 0.5em;
4042
+ padding-inline-start: 1.625em;
4043
+ }
4044
+ }
4045
+
4046
+ /* Figures */
4047
+ figure {
4048
+ margin-block: 2em;
4049
+
4050
+ & > * {
4051
+ margin-block: 0;
4052
+ }
4053
+
4054
+ & figcaption {
4055
+ font-size: 0.875em;
4056
+ line-height: 1.4285714;
4057
+ margin-block-start: 0.8571429em;
4058
+ }
4059
+ }
4060
+
4061
+ /* Remove top margin from first child */
4062
+ & > :first-child {
4063
+ margin-block-start: 0;
4064
+ }
4065
+
4066
+ /* Remove bottom margin from last child */
4067
+ & > :last-child {
4068
+ margin-block-end: 0;
4069
+ }
4070
+
4071
+ /* Horizontal rules */
4072
+ hr {
4073
+ & + * {
4074
+ margin-block-start: 0;
4075
+ }
4076
+ }
4077
+ }
4078
+ }
4079
+
4080
+ /* Utils */
4081
+
4082
+ @layer utils {
4083
+ /*
4084
+ Screen-reader only
4085
+ When you visibly want to hide an element but make it accessible for screen readers.
4086
+ */
4087
+ .sr-only {
4088
+ block-size: 1px;
4089
+ clip-path: inset(50%);
4090
+ inline-size: 1px;
4091
+ overflow: hidden;
4092
+ position: absolute;
4093
+ white-space: nowrap;
4094
+ }
4095
+
4096
+ /* Hover and active effect for checkbox, radio and icon buttons */
4097
+ :where(.checkbox input, .radio input, .icon-button) {
4098
+ --isLTR: 1;
4099
+ --isRTL: -1;
4100
+
4101
+ position: relative;
4102
+ transform-style: preserve-3d;
4103
+
4104
+ &:dir(rtl) {
4105
+ --isLTR: -1;
4106
+ --isRTL: 1;
4107
+ }
4108
+
4109
+ &:where(:not([disabled])) {
4110
+ &:hover:before {
4111
+ --thumb-scale: 1;
4112
+ }
4113
+
4114
+ &:active:before {
4115
+ --thumb-scale: 1.1;
4116
+ }
4117
+
4118
+ &::before {
4119
+ --thumb-scale: 0.01;
4120
+ --highlight-size: 150%;
4121
+
4122
+ background-color: oklch(0.6 0 0 / 0.2);
4123
+ block-size: var(--highlight-size);
4124
+ clip-path: circle(50%);
4125
+ content: "";
4126
+ inline-size: var(--highlight-size);
4127
+ inset-block-start: 50%;
4128
+ inset-inline-start: 50%;
4129
+ position: absolute;
4130
+ transform-origin: center center;
4131
+ transform: translateX(calc(var(--isRTL) * 50%)) translateY(-50%)
4132
+ translateZ(-1px) scale(var(--thumb-scale));
4133
+ will-change: transform;
4134
+
4135
+ @media (prefers-reduced-motion: no-preference) {
4136
+ transition: transform 0.2s ease;
4137
+ }
4138
+ }
4139
+ }
4140
+ }
4141
+ }