opui-css 3.3.5 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/CHANGELOG.md +241 -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 +64 -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 +5146 -0
  109. package/dist/opui.components.css.map +1 -0
  110. package/dist/opui.css +6615 -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 +81 -72
  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,281 +0,0 @@
1
- @layer components.root {
2
- :where(.button) {
3
- --_bg-color: transparent;
4
- --_border-color: transparent;
5
- --_border-radius: var(--button-border-radius);
6
- --_font-size: initial;
7
- --_min-height: 2.375rem;
8
- --_text-color: var(--primary);
9
-
10
- -webkit-tap-highlight-color: transparent;
11
- -webkit-touch-callout: none;
12
- align-items: center;
13
- background: var(--_bg-color) var(--ripple, none);
14
- border-radius: var(--_border-radius);
15
- border: var(--border-size-1) solid var(--_border-color);
16
- color: var(--_text-color);
17
- display: inline-flex;
18
- font-size: var(--_font-size);
19
- font-weight: 700;
20
- gap: var(--size-2);
21
- justify-content: center;
22
- min-block-size: var(--_min-height);
23
- padding-block: 0.5ex;
24
- padding-inline: 1.5ex;
25
- text-align: center;
26
- text-decoration: none;
27
-
28
- user-select: none;
29
-
30
- &:where([disabled]) {
31
- cursor: not-allowed;
32
- opacity: 0.64;
33
- }
34
-
35
- @media (prefers-reduced-motion: no-preference) {
36
- transition:
37
- background-color 0.2s var(--ease-out-3),
38
- box-shadow 0.2s var(--ease-out-3),
39
- border-color 0.2s var(--ease-out-3),
40
- color 0.2s var(--ease-out-3),
41
- outline-offset 0.05s var(--ease-1);
42
-
43
- /* Ripple effect */
44
- background-position: center;
45
-
46
- &:where(:not([disabled])) {
47
- &:where(:not(:active):hover) {
48
- --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%)
49
- center/15000%;
50
-
51
- transition: background var(--button-ripple-duration);
52
- }
53
-
54
- &:where(:hover:active) {
55
- background-size: var(--button-ripple-size);
56
- transition: background 0s;
57
- }
58
- }
59
- }
60
-
61
- /* Element states */
62
- &:where(:not([disabled])) {
63
- &:where(:not(:active):hover) {
64
- --_bg-color: light-dark(
65
- oklch(from var(--primary) l 0.01 h / 20%),
66
- oklch(from var(--primary) l 0.01 h / 40%)
67
- );
68
- }
69
-
70
- &:where(:hover:active) {
71
- --_bg-color: light-dark(
72
- oklch(from var(--primary) l 0.06 h / 30%),
73
- oklch(from var(--primary) l 0.06 h / 40%)
74
- );
75
- }
76
- }
77
-
78
- /* Disabled */
79
- &:where([disabled]) {
80
- --_text-color: color-mix(
81
- in oklch,
82
- var(--text-color-2) 50%,
83
- var(--surface-default)
84
- );
85
- }
86
-
87
- /* Icon */
88
- &:where(:has(svg), &.icon-only) {
89
- gap: 1ex;
90
-
91
- svg {
92
- max-block-size: 0.7lh;
93
- color: currentColor;
94
- }
95
- }
96
-
97
- /* Keyboard input */
98
- :is(kbd) {
99
- background-color: inherit;
100
- border-color: currentColor;
101
- color: inherit;
102
- font-size: 0.85em;
103
- line-height: 1.2;
104
- }
105
-
106
- /* Sizes */
107
- &.small {
108
- --_min-height: 1.875rem;
109
- padding-block: 0;
110
- padding-inline: 1ex;
111
- }
112
-
113
- &.large {
114
- --_min-height: 2.875rem;
115
- padding-inline: 4ex;
116
- }
117
-
118
- /* Variants */
119
- &.outlined {
120
- --_bg-color: var(--surface-default);
121
- --_border-color: var(--color-8);
122
- --_text-color: var(--color-8);
123
-
124
- &:where(:not([disabled])) {
125
- &:where(:not(:active):hover) {
126
- --_bg-color: var(--color-10);
127
- --_border-color: var(--color-10);
128
- --_text-color: var(--color-1);
129
- }
130
-
131
- &:where(:active) {
132
- --_bg-color: var(--color-9);
133
- --_border-color: var(--color-9);
134
- --_text-color: var(--color-1);
135
- }
136
- }
137
-
138
- &:where([disabled]) {
139
- --_bg-color: var(--surface-default);
140
- --_border-color: color-mix(
141
- in oklch,
142
- var(--text-color-2) 20%,
143
- var(--surface-default)
144
- );
145
- --_text-color: color-mix(
146
- in oklch,
147
- var(--text-color-2) 40%,
148
- var(--surface-default)
149
- );
150
- }
151
- }
152
- &.tonal {
153
- --_bg-color: var(--color-6);
154
- --_text-color: var(--color-16);
155
-
156
- &:where(:not([disabled])) {
157
- &:where(:not(:active):hover) {
158
- --_bg-color: var(--color-9);
159
- --_border-color: var(--color-9);
160
- }
161
-
162
- &:where(:active) {
163
- --_bg-color: var(--color-7);
164
- --_border-color: var(--color-7);
165
- }
166
- }
167
-
168
- &:where([disabled]) {
169
- --_bg-color: color-mix(
170
- in oklch,
171
- var(--text-color-2) 8%,
172
- var(--surface-default)
173
- );
174
- --_text-color: color-mix(
175
- in oklch,
176
- var(--text-color-2) 70%,
177
- var(--surface-default)
178
- );
179
- }
180
- }
181
- &.filled {
182
- --_bg-color: var(--color-8);
183
- --_text-color: var(--color-1);
184
-
185
- &:where(:not([disabled])) {
186
- &:where(:not(:active):hover) {
187
- --_bg-color: var(--color-10);
188
- --_border-color: var(--color-10);
189
- }
190
-
191
- &:where(:active) {
192
- --_bg-color: var(--color-9);
193
- --_border-color: var(--color-9);
194
- }
195
- }
196
-
197
- &:where([disabled]) {
198
- --_bg-color: color-mix(
199
- in oklch,
200
- var(--text-color-2) 20%,
201
- var(--surface-default)
202
- );
203
- --_text-color: color-mix(
204
- in oklch,
205
- var(--text-color-2) 70%,
206
- var(--surface-default)
207
- );
208
- }
209
- }
210
- &.elevated {
211
- --_bg-color: light-dark(
212
- color-mix(in oklch, var(--gray-2) 97%, var(--color-16)),
213
- color-mix(in oklch, var(--gray-13) 97%, var(--color-1))
214
- );
215
- --_ripple-color: light-dark(
216
- color-mix(in oklch, var(--gray-2) 80%, var(--color-8)),
217
- color-mix(in oklch, var(--gray-13) 80%, var(--color-8))
218
- );
219
- --_text-color: var(--color-8);
220
-
221
- box-shadow:
222
- 0px 3px 1px -2px oklch(0 0 0 / 20%),
223
- 0px 2px 2px 0px oklch(0 0 0 / 14%),
224
- 0px 1px 5px 0px oklch(0 0 0 / 12%);
225
-
226
- &:where(:not([disabled])) {
227
- &:where(:not(:active):hover) {
228
- --ripple: radial-gradient(
229
- circle,
230
- transparent 1%,
231
- var(--_ripple-color) 1%
232
- )
233
- center/15000%;
234
-
235
- --_bg-color: light-dark(
236
- color-mix(in oklch, var(--gray-2) 93%, var(--color-8)),
237
- color-mix(in oklch, var(--gray-13) 93%, var(--color-8))
238
- );
239
- }
240
-
241
- &:where(:hover:active) {
242
- --_bg-color: light-dark(
243
- color-mix(in oklch, var(--gray-2) 91%, var(--color-8)),
244
- color-mix(in oklch, var(--gray-13) 91%, var(--color-8))
245
- );
246
- }
247
- }
248
-
249
- &:where([disabled]) {
250
- --_bg-color: color-mix(
251
- in oklch,
252
- var(--text-color-2) 8%,
253
- var(--surface-elevated)
254
- );
255
- --_text-color: color-mix(
256
- in oklch,
257
- var(--text-color-2) 70%,
258
- var(--surface-elevated)
259
- );
260
- }
261
- }
262
- }
263
-
264
- /* file input */
265
- :where(input[type="file"]) {
266
- align-self: flex-start;
267
- border-radius: var(--radius-2);
268
- border: var(--border-size-1) solid var(--surface-filled);
269
- box-shadow: var(--inner-shadow-4);
270
- color: var(--text-color-2-contrast);
271
- cursor: initial;
272
- max-inline-size: 100%;
273
- padding: 0;
274
- }
275
-
276
- :where(input[type="file"])::-webkit-file-upload-button,
277
- :where(input[type="file"])::file-selector-button {
278
- cursor: pointer;
279
- margin-inline-end: var(--size-relative-6);
280
- }
281
- }
@@ -1,82 +0,0 @@
1
- @layer components.root {
2
- :where(.card) {
3
- --_bg-color: transparent;
4
- --_border-color: transparent;
5
- --_border-width: 0;
6
- --_shadow: none;
7
-
8
- background-color: var(--_bg-color);
9
- border-color: var(--_border-color);
10
- border-radius: var(--border-radius, 0.25rem);
11
- border-style: solid;
12
- border-width: var(--_border-width);
13
- box-shadow: var(--_shadow);
14
- display: flex;
15
- flex-direction: column;
16
- gap: var(--size-3);
17
- overflow: hidden;
18
- padding-inline: 0;
19
-
20
- /* Variants */
21
- &.text {
22
- --_bg-color: transparent;
23
- --_border-color: transparent;
24
- --_border-width: 0;
25
- --_shadow: none;
26
- padding-inline: 0;
27
- }
28
-
29
- &.tonal {
30
- --_bg-color: var(--surface-tonal);
31
- --_border-width: 1px;
32
- }
33
-
34
- &.elevated {
35
- --_bg-color: var(--surface-elevated);
36
- --_border-color: transparent;
37
- --_border-width: 0;
38
- --_shadow: var(--shadow-3);
39
-
40
- /* Adjust shadow in dark mode */
41
- @container style(--color-scheme: dark) {
42
- --_shadow: var(--shadow-4);
43
- }
44
- }
45
-
46
- &.outlined {
47
- --_bg-color: var(--surface-default);
48
- --_border-color: var(--border-color);
49
- --_border-width: 1px;
50
- }
51
-
52
- & > :where(hgroup, .content) {
53
- padding-inline: var(--size-3);
54
- }
55
-
56
- & > hgroup {
57
- padding-block: var(--size-3) 0;
58
-
59
- /* Top paragraph */
60
- & > p:first-of-type:first-child {
61
- line-height: 1.3;
62
- }
63
-
64
- /* Bottom paragraph */
65
- & > p:last-of-type:last-child:not(:first-child) {
66
- font-size: var(--font-size-1, 1rem);
67
- }
68
- }
69
-
70
- & > .content:where(:only-child, :first-child) {
71
- padding-block: var(--size-3) var(--size-4);
72
- }
73
-
74
- & > .actions {
75
- display: flex;
76
- gap: var(--size-1);
77
- margin-block: var(--size-2) 0;
78
- padding-block-end: var(--size-1);
79
- padding-inline: var(--size-1) var(--size-3);
80
- }
81
- }
82
- }
@@ -1,123 +0,0 @@
1
- @layer components.root {
2
- label:where(.checkbox, .radio) {
3
- align-items: center;
4
- color: var(--text-color-1);
5
- cursor: pointer;
6
- display: inline-grid;
7
- gap: 0 var(--size-2);
8
- grid-auto-columns: auto;
9
- grid-auto-flow: column;
10
- inline-size: fit-content;
11
- line-height: 1.5;
12
- transform: translateZ(0);
13
- user-select: none;
14
-
15
- /* Disabled */
16
- &:has([disabled]) {
17
- cursor: not-allowed;
18
- opacity: 0.64;
19
- user-select: none;
20
-
21
- input {
22
- cursor: not-allowed;
23
- }
24
- }
25
-
26
- /* Required dot */
27
- &:has([required]:not([type="checkbox"]:checked)) {
28
- .label:after {
29
- color: var(--red);
30
- content: "*";
31
- inset: 0 -0.25ex auto auto;
32
- position: absolute;
33
- }
34
- }
35
-
36
- /* Label */
37
- .label {
38
- grid-column: 2;
39
- grid-row: 1;
40
- position: relative;
41
- padding-inline: 0 1ex;
42
- }
43
-
44
- /* Supporting text */
45
- .supporting-text {
46
- color: var(--text-color-2);
47
- font-size: var(--font-size-xs);
48
- grid-column: 2;
49
- grid-row: 2;
50
- line-height: 1.5;
51
- z-index: 1;
52
- }
53
-
54
- /* Stacked layout */
55
- &.stack {
56
- justify-items: center;
57
- grid-auto-columns: unset;
58
-
59
- .label {
60
- grid-column: 1/-1;
61
- grid-row: 2;
62
- margin-block-start: var(--size-1);
63
- padding-inline: 1ex;
64
-
65
- /* Required dot */
66
- &::after {
67
- inset: 0 -0.25ex auto auto;
68
- }
69
- }
70
-
71
- .supporting-text {
72
- grid-column: 1/-1;
73
- grid-row: 3;
74
- }
75
- }
76
-
77
- /* Input */
78
- input {
79
- aspect-ratio: 1;
80
- block-size: 1.125rem;
81
- cursor: pointer;
82
- inline-size: 1.125rem;
83
-
84
- &::before {
85
- --highlight-size: 175%;
86
- }
87
- }
88
-
89
- /* Sizes */
90
- &.small {
91
- input {
92
- block-size: var(--size-3);
93
- inline-size: var(--size-3);
94
- }
95
- }
96
-
97
- &.large {
98
- input {
99
- block-size: var(--size-4);
100
- inline-size: var(--size-4);
101
- }
102
- }
103
-
104
- /* Validation */
105
- &.error {
106
- input[type="checkbox"] {
107
- accent-color: var(--color-9);
108
-
109
- & ~ :where(.label, .supporting-text) {
110
- color: var(--color-9);
111
- }
112
- }
113
- }
114
-
115
- /* Touch devices */
116
- @media (pointer: coarse) {
117
- input {
118
- block-size: var(--size-4);
119
- inline-size: var(--size-4);
120
- }
121
- }
122
- }
123
- }
@@ -1,68 +0,0 @@
1
- @layer components.root {
2
- :where(.definition-list) {
3
- --_border-style: solid;
4
- --_border-width: 1px;
5
-
6
- display: grid;
7
- gap: var(--size-3);
8
- padding: 0;
9
-
10
- &.dotted {
11
- --_border-style: dotted;
12
- --_border-width: 2px;
13
- }
14
-
15
- li {
16
- display: grid;
17
- margin: 0;
18
- padding: 0;
19
-
20
- .term {
21
- display: block;
22
- font-weight: 700;
23
- overflow: hidden;
24
- position: relative;
25
- }
26
-
27
- hr {
28
- display: none;
29
- margin: 0;
30
- }
31
- }
32
-
33
- @container (width > 45ch) {
34
- gap: var(--size-1);
35
-
36
- li {
37
- align-items: baseline;
38
- display: grid;
39
- gap: var(--size-1);
40
- grid-template-columns: 1fr auto;
41
-
42
- &:has(hr) {
43
- grid-template-columns: auto 1fr auto;
44
- }
45
-
46
- hr {
47
- background-color: transparent;
48
- border-block-end: var(--_border-width) var(--_border-style)
49
- var(--border-color);
50
- block-size: 2px;
51
- display: block;
52
- }
53
-
54
- .term {
55
- inline-size: max-content;
56
-
57
- &::after {
58
- display: inline-block;
59
- }
60
- }
61
- .description {
62
- color: var(--text-color-2);
63
- text-align: end;
64
- }
65
- }
66
- }
67
- }
68
- }
@@ -1,59 +0,0 @@
1
- @layer components.extended {
2
- :where(dialog) {
3
- margin-block-start: 15%; /* vertical alignment */
4
- padding-block: 0;
5
- pointer-events: none;
6
-
7
- &::backdrop {
8
- background-color: rgba(0, 0, 0, 0.5);
9
- backdrop-filter: blur(5px);
10
-
11
- @media (prefers-reduced-motion: reduce) {
12
- backdrop-filter: none;
13
- }
14
- }
15
-
16
- &:not([open]) {
17
- display: none;
18
- }
19
-
20
- &[open] {
21
- pointer-events: all;
22
- }
23
-
24
- .actions {
25
- justify-content: end;
26
- padding-inline: var(--size-3) var(--size-1);
27
- }
28
-
29
- /* Animation */
30
- /* There's no close animation, intentionally */
31
- opacity: 0;
32
-
33
- &[open] {
34
- opacity: 1;
35
- transition: display 0.2s allow-discrete,
36
- margin-block-start 0.3s var(--ease-1), overlay 0.2s allow-discrete,
37
- opacity 0.2s var(--ease-out-1);
38
-
39
- @starting-style {
40
- opacity: 0;
41
- }
42
- }
43
-
44
- @media (prefers-reduced-motion: no-preference) {
45
- margin-block-start: 17%;
46
- &[open] {
47
- margin-block-start: 15%;
48
-
49
- @starting-style {
50
- margin-block-start: 17%;
51
- }
52
- }
53
- }
54
- }
55
-
56
- :where(html:has(dialog[open])) {
57
- overflow: hidden;
58
- }
59
- }
@@ -1,7 +0,0 @@
1
- @layer components.root {
2
- :where(hr) {
3
- background-color: var(--border-color);
4
- block-size: var(--border-size-1);
5
- margin-block: var(--size-fluid-3);
6
- }
7
- }
@@ -1,83 +0,0 @@
1
- @layer components.extended {
2
- /* Common styling for checkbox, radio and switch groups */
3
- :where(fieldset.field-group) {
4
- border: 0;
5
- border-radius: 0;
6
- gap: 0;
7
- padding: 0;
8
- z-index: 1;
9
-
10
- legend {
11
- color: var(--text-color-2);
12
- padding: 0 1ex 0 0;
13
- }
14
-
15
- /* Disabled */
16
- &[disabled] {
17
- cursor: not-allowed;
18
- opacity: 0.64;
19
- user-select: none;
20
-
21
- input {
22
- cursor: not-allowed;
23
- }
24
- }
25
-
26
- /* Validation */
27
- &.error {
28
- legend,
29
- .supporting-text {
30
- color: var(--color-9);
31
- }
32
- }
33
-
34
- /* Required */
35
- &:has([required]) {
36
- &:not(:has(input:where([type="radio"], [type="checkbox"]):checked)) {
37
- legend {
38
- position: relative;
39
-
40
- &::after {
41
- color: var(--red);
42
- content: "*";
43
- inset: 0 -0.25ex auto auto;
44
- position: absolute;
45
- }
46
- }
47
- }
48
- }
49
- :where(.radio, .checkbox, .switch) .label:after {
50
- display: none;
51
- }
52
-
53
- /* Supporting text */
54
- .supporting-text {
55
- color: var(--text-color-2);
56
- font-size: var(--font-size-xs);
57
- line-height: 1.5;
58
- z-index: 1;
59
- }
60
-
61
- /* Fields */
62
- .fields {
63
- display: flex;
64
- flex-direction: column;
65
- gap: var(--size-2);
66
-
67
- * ~ & {
68
- padding: var(--size-2) 0;
69
- }
70
- }
71
-
72
- :last-child {
73
- padding-block-end: 0;
74
- }
75
-
76
- /* Directions */
77
- &.row {
78
- .fields {
79
- flex-direction: row;
80
- }
81
- }
82
- }
83
- }