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