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