opui-css 3.3.4 → 4.0.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.
Files changed (174) hide show
  1. package/CHANGELOG.md +235 -0
  2. package/LICENSE +21 -21
  3. package/MIGRATING.md +105 -0
  4. package/README.md +66 -29
  5. package/astro/index.ts +46 -0
  6. package/components/AGENTS.md +247 -0
  7. package/components/Accordion/Accordion.astro +42 -0
  8. package/components/Anchor/Anchor.astro +51 -0
  9. package/components/Avatar/Avatar.astro +44 -0
  10. package/components/Badge/Badge.astro +54 -0
  11. package/components/Button/Button.astro +45 -0
  12. package/components/ButtonGroup/ButtonGroup.astro +29 -0
  13. package/components/Callout/Callout.astro +75 -0
  14. package/components/Card/Card.astro +38 -0
  15. package/components/Checkbox/Checkbox.astro +76 -0
  16. package/components/Checkbox/CheckboxInput.astro +32 -0
  17. package/components/Chip/Chip.astro +37 -0
  18. package/components/ClassicSelect/ClassicSelect.astro +83 -0
  19. package/components/DescriptionList/Description.astro +12 -0
  20. package/components/DescriptionList/DescriptionList.astro +22 -0
  21. package/components/DescriptionList/Item.astro +12 -0
  22. package/components/DescriptionList/Term.astro +12 -0
  23. package/components/DescriptionList/index.ts +12 -0
  24. package/components/Dialog/Dialog.astro +43 -0
  25. package/components/Divider/Divider.astro +14 -0
  26. package/components/Drawer/Drawer.astro +49 -0
  27. package/components/Drawer/DrawerFooter.astro +14 -0
  28. package/components/Drawer/DrawerHeader.astro +31 -0
  29. package/components/FieldDescription/FieldDescription.astro +13 -0
  30. package/components/FieldGroup/FieldGroup.astro +31 -0
  31. package/components/FieldLegend/FieldLegend.astro +15 -0
  32. package/components/FieldSet/FieldSet.astro +15 -0
  33. package/components/Form/Form.astro +15 -0
  34. package/components/IconButton/IconButton.astro +26 -0
  35. package/components/List/List.astro +36 -0
  36. package/components/ListItem/ListItem.astro +118 -0
  37. package/components/Progress/Progress.astro +40 -0
  38. package/components/Radio/Radio.astro +70 -0
  39. package/components/Radio/RadioInput.astro +24 -0
  40. package/components/Range/Range.astro +136 -0
  41. package/components/Select/Select.astro +106 -0
  42. package/components/Switch/Switch.astro +101 -0
  43. package/components/Switch/SwitchInput.astro +25 -0
  44. package/components/Table/Body.astro +13 -0
  45. package/components/Table/Cell.astro +13 -0
  46. package/components/Table/Column.astro +15 -0
  47. package/components/Table/ColumnGroup.astro +13 -0
  48. package/components/Table/Head.astro +13 -0
  49. package/components/Table/HeaderCell.astro +13 -0
  50. package/components/Table/Row.astro +13 -0
  51. package/components/Table/Table.astro +15 -0
  52. package/components/Table/index.ts +20 -0
  53. package/components/Tabs/Tabs.astro +28 -0
  54. package/components/Tabs/TabsItem.astro +47 -0
  55. package/components/Tabs/TabsPanel.astro +21 -0
  56. package/components/Tabs/TabsTab.astro +19 -0
  57. package/components/Tabs/index.ts +14 -0
  58. package/components/TextField/TextField.astro +128 -0
  59. package/components/Textarea/Textarea.astro +106 -0
  60. package/components/Toast/Toast.astro +42 -0
  61. package/components/ToggleButton/ToggleButton.astro +53 -0
  62. package/components/ToggleGroup/ToggleGroup.astro +49 -0
  63. package/components/Tooltip/Tooltip.astro +30 -0
  64. package/{src/core → core}/normalize.css +194 -196
  65. package/core/palette.css +59 -0
  66. package/{src/core → core}/utils.css +71 -60
  67. package/css/components/accordion.css +174 -0
  68. package/css/components/anchor.css +27 -0
  69. package/{src/themes/theme-two → css}/components/avatar.css +65 -68
  70. package/css/components/badge.css +107 -0
  71. package/css/components/button-group.css +179 -0
  72. package/css/components/button.css +215 -0
  73. package/css/components/callout.css +109 -0
  74. package/css/components/card.css +117 -0
  75. package/css/components/checkbox.css +205 -0
  76. package/{src/themes/theme-one → css}/components/chip.css +87 -135
  77. package/{src/themes/theme-two/components/definition-list.css → css/components/description-list.css} +77 -68
  78. package/{src/themes/theme-two → css}/components/dialog.css +68 -59
  79. package/css/components/divider.css +20 -0
  80. package/css/components/drawer.css +171 -0
  81. package/css/components/form.css +146 -0
  82. package/css/components/icon-button.css +139 -0
  83. package/{src/themes/theme-two → css}/components/link.css +21 -21
  84. package/{src/themes/theme-two → css}/components/list.css +345 -318
  85. package/{src/themes/theme-one → css}/components/progress.css +97 -83
  86. package/css/components/radio.css +172 -0
  87. package/css/components/range.css +337 -0
  88. package/{src/themes/theme-two → css}/components/select.css +169 -162
  89. package/{src/themes/theme-two → css}/components/spinner.css +37 -38
  90. package/{src/themes/theme-two → css}/components/switch.css +268 -225
  91. package/css/components/table.css +179 -0
  92. package/css/components/tabs.css +77 -0
  93. package/css/components/text-field.css +450 -0
  94. package/css/components/text-input.css +53 -0
  95. package/{src/themes/theme-two → css}/components/textarea.css +24 -25
  96. package/css/components/toast.css +161 -0
  97. package/css/components/toggle-button.css +87 -0
  98. package/css/components/toggle-group.css +56 -0
  99. package/css/components/tooltip.css +67 -0
  100. package/css/components/typography.css +585 -0
  101. package/{src/themes/theme-two → css}/components.css +41 -37
  102. package/{src/themes/theme-two → css}/imports.css +16 -16
  103. package/css/js/checkbox.js +21 -0
  104. package/css/js/toast.js +94 -0
  105. package/css/theme.css +132 -0
  106. package/dist/op.css +1001 -32
  107. package/dist/op.css.map +1 -0
  108. package/dist/opui.components.css +5135 -0
  109. package/dist/opui.components.css.map +1 -0
  110. package/dist/opui.css +6604 -0
  111. package/dist/opui.css.map +1 -0
  112. package/env.d.ts +14 -0
  113. package/open-props.css +9 -0
  114. package/package.json +64 -55
  115. package/dist/theme-one/components.css +0 -3869
  116. package/dist/theme-one/theme-one.css +0 -4424
  117. package/dist/theme-two/components.css +0 -3591
  118. package/dist/theme-two/theme-two.css +0 -4141
  119. package/src/open-props.css +0 -10
  120. package/src/themes/theme-one/components/accordion.css +0 -172
  121. package/src/themes/theme-one/components/alert.css +0 -85
  122. package/src/themes/theme-one/components/avatar.css +0 -68
  123. package/src/themes/theme-one/components/badge.css +0 -101
  124. package/src/themes/theme-one/components/button-group.css +0 -69
  125. package/src/themes/theme-one/components/button.css +0 -281
  126. package/src/themes/theme-one/components/card.css +0 -82
  127. package/src/themes/theme-one/components/checkbox-radio.css +0 -123
  128. package/src/themes/theme-one/components/definition-list.css +0 -68
  129. package/src/themes/theme-one/components/dialog.css +0 -59
  130. package/src/themes/theme-one/components/divider.css +0 -7
  131. package/src/themes/theme-one/components/field-group.css +0 -83
  132. package/src/themes/theme-one/components/field.css +0 -494
  133. package/src/themes/theme-one/components/icon-button.css +0 -40
  134. package/src/themes/theme-one/components/link.css +0 -21
  135. package/src/themes/theme-one/components/list.css +0 -318
  136. package/src/themes/theme-one/components/range.css +0 -121
  137. package/src/themes/theme-one/components/rich-text.css +0 -210
  138. package/src/themes/theme-one/components/select.css +0 -163
  139. package/src/themes/theme-one/components/snackbar.css +0 -148
  140. package/src/themes/theme-one/components/spinner.css +0 -38
  141. package/src/themes/theme-one/components/switch.css +0 -225
  142. package/src/themes/theme-one/components/tab-buttons.css +0 -120
  143. package/src/themes/theme-one/components/table.css +0 -92
  144. package/src/themes/theme-one/components/text-field.css +0 -57
  145. package/src/themes/theme-one/components/textarea.css +0 -25
  146. package/src/themes/theme-one/components/toggle-button-group.css +0 -135
  147. package/src/themes/theme-one/components/tooltip.css +0 -94
  148. package/src/themes/theme-one/components/typography.css +0 -209
  149. package/src/themes/theme-one/components.css +0 -37
  150. package/src/themes/theme-one/imports.css +0 -16
  151. package/src/themes/theme-one/theme.css +0 -163
  152. package/src/themes/theme-two/components/accordion.css +0 -172
  153. package/src/themes/theme-two/components/alert.css +0 -85
  154. package/src/themes/theme-two/components/badge.css +0 -101
  155. package/src/themes/theme-two/components/button-group.css +0 -50
  156. package/src/themes/theme-two/components/button.css +0 -229
  157. package/src/themes/theme-two/components/card.css +0 -82
  158. package/src/themes/theme-two/components/checkbox-radio.css +0 -123
  159. package/src/themes/theme-two/components/chip.css +0 -135
  160. package/src/themes/theme-two/components/divider.css +0 -7
  161. package/src/themes/theme-two/components/field-group.css +0 -83
  162. package/src/themes/theme-two/components/field.css +0 -281
  163. package/src/themes/theme-two/components/icon-button.css +0 -40
  164. package/src/themes/theme-two/components/progress.css +0 -83
  165. package/src/themes/theme-two/components/range.css +0 -121
  166. package/src/themes/theme-two/components/rich-text.css +0 -210
  167. package/src/themes/theme-two/components/snackbar.css +0 -148
  168. package/src/themes/theme-two/components/tab-buttons.css +0 -120
  169. package/src/themes/theme-two/components/table.css +0 -99
  170. package/src/themes/theme-two/components/text-field.css +0 -57
  171. package/src/themes/theme-two/components/toggle-button-group.css +0 -135
  172. package/src/themes/theme-two/components/tooltip.css +0 -94
  173. package/src/themes/theme-two/components/typography.css +0 -209
  174. package/src/themes/theme-two/theme.css +0 -158
@@ -1,318 +1,345 @@
1
- @layer components.extended {
2
- /*
3
- Lists meant to be used stand-alone or as part of Select elements
4
-
5
- Intended use-case:
6
- - ul.list > li
7
- - .select > .list > option
8
- */
9
- :where(.list) {
10
- --_bg-color: light-dark(var(--gray-1), var(--gray-15));
11
- --_bg-color-hover: light-dark(var(--gray-2), var(--gray-14));
12
-
13
- background-color: var(--_bg-color);
14
- list-style: none;
15
- padding: var(--size-2) 0;
16
-
17
- @media (pointer: coarse) {
18
- &,
19
- * {
20
- user-select: none;
21
- }
22
- }
23
-
24
- /* Borders on all list items */
25
- &.bordered {
26
- :where(li + li, option + option) {
27
- margin-block-start: var(--size-3);
28
- &::before {
29
- block-size: 1px;
30
- border-block-start: 1px solid var(--border-color);
31
- content: "";
32
- display: block;
33
- inline-size: 100%;
34
- inset: calc(-1 * var(--size-2)) 0 auto 0;
35
- position: absolute;
36
- visibility: visible; /* override select > option:before style */
37
- }
38
- }
39
- }
40
-
41
- /* Dense - less gaps and spacing */
42
- &.dense {
43
- :where(li, option) {
44
- gap: var(--size-2);
45
- min-block-size: var(--size-7);
46
- padding: var(--size-1) var(--size-2);
47
-
48
- &.border-top {
49
- margin-block-start: var(--size-2);
50
- &::before {
51
- inset: calc(-1 * var(--size-1)) 0 auto 0;
52
- }
53
- }
54
-
55
- /* Clickable list item */
56
- &:has(> a, > button, > label) {
57
- min-block-size: auto;
58
- padding: 0;
59
- }
60
-
61
- & > :where(a, button, label) {
62
- gap: var(--size-2);
63
- min-block-size: var(--size-7);
64
- padding: var(--size-1) var(--size-2);
65
- }
66
-
67
- /* Checkbox / Radio */
68
- & > label {
69
- .end {
70
- padding-inline-end: 0.125rem;
71
- }
72
- }
73
-
74
- /* Leading and trailing content */
75
- .start,
76
- .end {
77
- .avatar {
78
- max-inline-size: var(--size-6);
79
- }
80
-
81
- .icon-button,
82
- svg {
83
- max-inline-size: var(--size-4);
84
- }
85
-
86
- .checkbox,
87
- .radio {
88
- max-inline-size: var(--size-3);
89
- }
90
- }
91
- }
92
- }
93
-
94
- /* Gutterless */
95
- &.gutterless {
96
- :where(li, option) {
97
- padding-inline: 0;
98
-
99
- & > :where(a, button, label) {
100
- padding-inline: 0;
101
- }
102
- }
103
- }
104
-
105
- /* List item */
106
- :where(li, option, [role="group"] > label) {
107
- align-items: center;
108
- background: var(--_bg-color) var(--ripple, none);
109
- display: flex;
110
- font-size: var(--font-size-sm);
111
- gap: var(--size-3);
112
- isolation: isolate;
113
- min-block-size: 40px;
114
- padding: var(--size-2) var(--size-3);
115
- position: relative;
116
-
117
- &::before {
118
- display: none; /* removing checkmark from option */
119
- }
120
-
121
- * {
122
- font-size: inherit;
123
- }
124
-
125
- /* Clickable list item */
126
- &:has(> a, > button, > label) {
127
- background: transparent;
128
- display: block;
129
- min-block-size: auto;
130
- padding: 0;
131
- }
132
-
133
- /* Select option */
134
- &:where(option) {
135
- align-items: center;
136
- background-color: var(--_bg-color);
137
- color: inherit;
138
- cursor: pointer;
139
- display: flex;
140
- gap: var(--size-3);
141
- inline-size: 100%;
142
- margin: 0;
143
- min-block-size: 40px;
144
- padding: var(--size-2) var(--size-3);
145
- text-align: start;
146
- text-decoration: none;
147
- z-index: 0;
148
-
149
- &:hover {
150
- background-color: var(--_bg-color-hover);
151
- }
152
-
153
- &:checked {
154
- background-color: oklch(from var(--primary) l c h / 30%);
155
- }
156
- }
157
-
158
- & > a,
159
- & > button,
160
- & > label {
161
- align-items: center;
162
- background: var(--_bg-color) var(--ripple, none);
163
- color: inherit;
164
- cursor: pointer;
165
- display: flex;
166
- gap: var(--size-3);
167
- inline-size: 100%;
168
- margin: 0;
169
- min-block-size: 40px;
170
- outline-offset: -3px;
171
- padding: var(--size-2) var(--size-3);
172
- text-align: start;
173
- text-decoration: none;
174
- z-index: 0;
175
-
176
- /*** Ripple effect */
177
- background-position: center;
178
- transition: background var(--button-ripple-duration);
179
- &:where(:not(:active):hover) {
180
- --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%)
181
- center/15000%;
182
- }
183
-
184
- &:where(:hover:active) {
185
- background-size: var(--button-ripple-size);
186
- transition: background 0s;
187
- }
188
-
189
- &:hover {
190
- background-color: var(--_bg-color-hover);
191
- }
192
-
193
- /*** Remove ripple effect when trailing button is clicked */
194
- &:has(.end:hover) {
195
- &:where(:not(:active):hover) {
196
- --ripple: none;
197
- }
198
- }
199
- }
200
-
201
- /* Checkbox / Radio / Switch */
202
- & > label {
203
- .end {
204
- padding-inline-end: var(--size-1);
205
- }
206
-
207
- &:where(.checkbox, .radio) {
208
- inline-size: 100%;
209
- }
210
-
211
- &.switch {
212
- --_dot-size: 0.75rem;
213
- --_track-height: var(--size-4);
214
- --_track-width: 2.5rem;
215
- }
216
- }
217
-
218
- /* Video */
219
- &:has(video) {
220
- padding: 0.75rem var(--size-3) 0.75rem 0;
221
- }
222
-
223
- /* Border between list items */
224
- &.border-top {
225
- margin-block-start: var(--size-3);
226
- &::before {
227
- block-size: 1px;
228
- border-block-start: 1px solid var(--border-color);
229
- content: "";
230
- display: block;
231
- inline-size: 100%;
232
- inset: calc(-1 * var(--size-2)) 0 auto 0;
233
- position: absolute;
234
- }
235
- }
236
-
237
- /* Text */
238
- .text {
239
- flex: 1;
240
- line-height: 1.6;
241
-
242
- :where(h1, h2, h3, h4, h5, h6, p, span) {
243
- color: inherit;
244
- font-weight: 400;
245
- }
246
-
247
- p + p {
248
- font-size: var(--font-size-xs);
249
- }
250
- }
251
-
252
- /* Leading content */
253
- .start {
254
- align-self: center;
255
- align-items: center;
256
- display: grid;
257
- z-index: 1;
258
-
259
- &:has(svg) {
260
- max-inline-size: var(--size-5);
261
- }
262
-
263
- svg {
264
- padding-block-start: 0.125rem;
265
- }
266
-
267
- img {
268
- aspect-ratio: 1;
269
- inline-size: 56px;
270
- object-fit: cover;
271
- }
272
-
273
- video {
274
- aspect-ratio: 16/9;
275
- block-size: 64px;
276
- object-fit: cover;
277
- }
278
- }
279
-
280
- /* Trailing content */
281
- .end {
282
- align-items: center;
283
- display: flex;
284
- font-size: var(--font-size-xs);
285
- text-align: end;
286
- z-index: 1;
287
-
288
- &:not(:has(a, button, input)) {
289
- pointer-events: none;
290
- }
291
-
292
- kbd {
293
- background-color: transparent;
294
- border: 0;
295
- color: inherit;
296
- opacity: 0.6;
297
- }
298
-
299
- svg {
300
- max-inline-size: var(--size-5);
301
- inline-size: 100%;
302
- }
303
- }
304
-
305
- /* Inset */
306
- &.inset {
307
- .text {
308
- padding-inline-start: calc(var(--size-5) + var(--size-3));
309
- }
310
-
311
- /* Safety measure so it won't look bad if there for some reason should exist a leading element inside. */
312
- .start {
313
- display: none;
314
- }
315
- }
316
- }
317
- }
318
- }
1
+ @layer components.extended {
2
+
3
+ /*
4
+ Lists meant to be used stand-alone or as part of Select elements
5
+
6
+ Intended use-case:
7
+ - ul.list > li
8
+ - .select > .list > option
9
+ */
10
+ :where(.list) {
11
+ --_bg-color: var(--surface-filled);
12
+ --_bg-color-hover: oklch(from var(--primary) l c h / 15%);
13
+
14
+ background-color: var(--_bg-color);
15
+ color: var(--text-primary);
16
+ list-style: none;
17
+ padding: var(--size-2) 0;
18
+
19
+ @media (pointer: coarse) {
20
+
21
+ &,
22
+ * {
23
+ user-select: none;
24
+ }
25
+ }
26
+
27
+ /* Background color */
28
+ &.transparent {
29
+ --_bg-color: transparent;
30
+ }
31
+
32
+ &.default {
33
+ --_bg-color: var(--surface-default);
34
+ }
35
+
36
+ &.tonal {
37
+ --_bg-color: var(--surface-tonal);
38
+ }
39
+
40
+ /* Borders on all list items */
41
+ &.bordered {
42
+ :where(li + li, option + option) {
43
+ margin-block-start: var(--size-3);
44
+
45
+ &::before {
46
+ block-size: 1px;
47
+ border-block-start: 1px solid var(--border-color);
48
+ content: "";
49
+ display: block;
50
+ inline-size: 100%;
51
+ inset: calc(-1 * var(--size-2)) 0 auto 0;
52
+ position: absolute;
53
+ visibility: visible;
54
+ /* override select > option:before style */
55
+ }
56
+ }
57
+ }
58
+
59
+ /* Dense - less gaps and spacing */
60
+ &.dense {
61
+ :where(li, option) {
62
+ gap: var(--size-2);
63
+ min-block-size: var(--size-7);
64
+ padding: var(--size-1) var(--size-2);
65
+
66
+ &.border-top {
67
+ margin-block-start: var(--size-2);
68
+
69
+ &::before {
70
+ inset: calc(-1 * var(--size-1)) 0 auto 0;
71
+ }
72
+ }
73
+
74
+ /* Clickable list item */
75
+ &:has(> a, > button, > label) {
76
+ min-block-size: auto;
77
+ padding: 0;
78
+ }
79
+
80
+ &> :where(a, button, label) {
81
+ gap: var(--size-2);
82
+ min-block-size: var(--size-7);
83
+ padding: var(--size-1) var(--size-2);
84
+ }
85
+
86
+ /* Checkbox / Radio */
87
+ &>label {
88
+ .end {
89
+ padding-inline-end: 0.125rem;
90
+ }
91
+
92
+ &:where(.checkbox, .radio) {
93
+ --_input-size: var(--size-3);
94
+ }
95
+ }
96
+
97
+ /* Leading and trailing content */
98
+ .start,
99
+ .end {
100
+ .avatar {
101
+ max-inline-size: var(--size-6);
102
+ }
103
+
104
+ .icon-button,
105
+ svg {
106
+ max-inline-size: var(--size-4);
107
+ }
108
+
109
+ .checkbox,
110
+ .radio {
111
+ --_input-size: var(--size-3);
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ /* Gutterless */
118
+ &.gutterless {
119
+ :where(li, option) {
120
+ padding-inline: 0;
121
+
122
+ &> :where(a, button, label) {
123
+ padding-inline: 0;
124
+ }
125
+ }
126
+ }
127
+
128
+ /* List item */
129
+ :where(li, option, [role="group"] > label) {
130
+ align-items: center;
131
+ background-color: var(--_bg-color);
132
+ display: flex;
133
+ font-size: var(--font-size-05);
134
+ gap: var(--size-3);
135
+ isolation: isolate;
136
+ min-block-size: 40px;
137
+ padding: var(--size-2) var(--size-3);
138
+ position: relative;
139
+
140
+ &::before {
141
+ display: none;
142
+ /* removing checkmark from option */
143
+ }
144
+
145
+ * {
146
+ font-size: inherit;
147
+ }
148
+
149
+ /* Clickable list item */
150
+ &:has(> a, > button, > label) {
151
+ background: transparent;
152
+ display: block;
153
+ min-block-size: auto;
154
+ padding: 0;
155
+
156
+ &[aria-selected="true"]> :where(a, button, label),
157
+ &[aria-selected="true"],
158
+ &:has(> [aria-current="page"])> :where(a, button, label) {
159
+ background-color: var(--_bg-color-hover);
160
+ }
161
+ }
162
+
163
+ /* Select option */
164
+ &:where(option) {
165
+ align-items: center;
166
+ background-color: var(--_bg-color);
167
+ color: inherit;
168
+ cursor: pointer;
169
+ display: flex;
170
+ gap: var(--size-3);
171
+ inline-size: 100%;
172
+ margin: 0;
173
+ min-block-size: 40px;
174
+ padding: var(--size-2) var(--size-3);
175
+ text-align: start;
176
+ text-decoration: none;
177
+ z-index: 0;
178
+
179
+ &:hover {
180
+ background-color: var(--_bg-color-hover);
181
+ }
182
+
183
+ &[aria-selected="true"] {
184
+ background-color: var(--_bg-color-hover);
185
+ color: var(--primary);
186
+ }
187
+
188
+ &:checked {
189
+ background-color: oklch(from var(--primary) l c h / 30%);
190
+ }
191
+ }
192
+
193
+ &>a,
194
+ &>button,
195
+ &>label {
196
+ align-items: center;
197
+ background-color: var(--_bg-color);
198
+ color: inherit;
199
+ cursor: pointer;
200
+ display: flex;
201
+ gap: var(--size-3);
202
+ inline-size: 100%;
203
+ margin: 0;
204
+ min-block-size: 40px;
205
+ outline-offset: -3px;
206
+ padding: var(--size-2) var(--size-3);
207
+ text-align: start;
208
+ text-decoration: none;
209
+ z-index: 0;
210
+
211
+ &:hover {
212
+ background-color: var(--_bg-color-hover);
213
+ }
214
+
215
+ &[aria-selected="true"],
216
+ &[aria-current="page"] {
217
+ background-color: var(--_bg-color-hover);
218
+ }
219
+ }
220
+
221
+ /* Checkbox / Radio / Switch */
222
+ &>label {
223
+ &:where(.checkbox, .radio, .switch) {
224
+ display: flex;
225
+ }
226
+
227
+ .end {
228
+ padding-inline-end: var(--size-1);
229
+ }
230
+
231
+ &:where(.checkbox, .radio) {
232
+ inline-size: 100%;
233
+ }
234
+
235
+ /* Switches look comically big in lists, so it's better to use a smaller variant */
236
+ &.switch {
237
+ --_dot-size: 0.75rem;
238
+ --_track-height: var(--size-4);
239
+ --_track-width: 2.5rem;
240
+ }
241
+ }
242
+
243
+ /* Video */
244
+ &:has(video) {
245
+ padding: 0.75rem var(--size-3) 0.75rem 0;
246
+ }
247
+
248
+ /* Border between list items */
249
+ &.border-top {
250
+ margin-block-start: var(--size-3);
251
+
252
+ &::before {
253
+ block-size: 1px;
254
+ border-block-start: 1px solid var(--border-color);
255
+ content: "";
256
+ display: block;
257
+ inline-size: 100%;
258
+ inset: calc(-1 * var(--size-2)) 0 auto 0;
259
+ position: absolute;
260
+ }
261
+ }
262
+
263
+ /* Text */
264
+ .text {
265
+ flex: 1;
266
+ line-height: 1.6;
267
+
268
+ :where(h1, h2, h3, h4, h5, h6, p, span) {
269
+ color: inherit;
270
+ font-weight: 400;
271
+ }
272
+
273
+ p+p {
274
+ color: var(--text-muted);
275
+ font-size: var(--font-size-0);
276
+ }
277
+ }
278
+
279
+ /* Leading content */
280
+ .start {
281
+ align-items: center;
282
+ align-self: center;
283
+ display: grid;
284
+ z-index: 1;
285
+
286
+ &:has(svg) {
287
+ max-inline-size: var(--size-5);
288
+ }
289
+
290
+ svg {
291
+ padding-block-start: 0.125rem;
292
+ }
293
+
294
+ img {
295
+ aspect-ratio: 1;
296
+ inline-size: 56px;
297
+ object-fit: cover;
298
+ }
299
+
300
+ video {
301
+ aspect-ratio: 16/9;
302
+ block-size: 64px;
303
+ object-fit: cover;
304
+ }
305
+ }
306
+
307
+ /* Trailing content */
308
+ .end {
309
+ align-items: center;
310
+ display: flex;
311
+ font-size: var(--font-size-0);
312
+ text-align: end;
313
+ z-index: 1;
314
+
315
+ &:not(:has(a, button, input)) {
316
+ pointer-events: none;
317
+ }
318
+
319
+ kbd {
320
+ background-color: transparent;
321
+ border: 0;
322
+ color: inherit;
323
+ opacity: 0.6;
324
+ }
325
+
326
+ svg {
327
+ inline-size: 100%;
328
+ max-inline-size: var(--size-5);
329
+ }
330
+ }
331
+
332
+ /* Inset */
333
+ &.inset {
334
+ .text {
335
+ padding-inline-start: calc(var(--size-5) + var(--size-3));
336
+ }
337
+
338
+ /* Safety measure so it won't look bad if there for some reason should exist a leading element inside. */
339
+ .start {
340
+ display: none;
341
+ }
342
+ }
343
+ }
344
+ }
345
+ }