opui-css 5.4.0 → 5.4.2

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.
@@ -3,9 +3,6 @@
3
3
  --_motion: var(--motion, 1);
4
4
  display: grid;
5
5
  gap: var(--size-1) 0;
6
- /* Two-column base so the optional .value cell can sit next to the
7
- label on row 1. Children that span the full width keep using
8
- `grid-column: 1/-1`, so this is backwards compatible. */
9
6
  grid-template-columns: 1fr auto;
10
7
  position: relative;
11
8
 
@@ -17,8 +14,6 @@
17
14
  grid-row: 1;
18
15
  }
19
16
 
20
- /* Live current-value readout. Pairs with the <output> element
21
- rendered by the Range component (or hand-written .value markup). */
22
17
  :where(.ui-value) {
23
18
  color: var(--text-muted);
24
19
  font-size: var(--font-size-0);
@@ -57,7 +52,7 @@
57
52
  margin-top: calc(var(--size-1) * -1);
58
53
  padding-inline: calc(3ex / 2);
59
54
 
60
- & > option {
55
+ &>option {
61
56
  display: flex;
62
57
  inline-size: 0;
63
58
  justify-content: center;
@@ -121,9 +116,6 @@
121
116
  min-inline-size: 25ch;
122
117
  }
123
118
 
124
- /* In spread mode, the value sits below the slider in col 2
125
- (where end-text would normally land). When end-text is also
126
- present it shifts down a row to avoid collision. */
127
119
  :where(.ui-value) {
128
120
  grid-column: 2;
129
121
  grid-row: 2;
@@ -140,8 +132,6 @@
140
132
  grid-row: 2;
141
133
  }
142
134
 
143
- /* When both datalist and end-text exist, push end-text below the datalist
144
- so they don't collide on the same grid cell. */
145
135
  &:has(datalist) :where(.ui-end-text) {
146
136
  grid-row: 3;
147
137
  }
@@ -165,9 +155,6 @@
165
155
  grid-row: 1;
166
156
  }
167
157
 
168
- /* Share row 1 with the label: the label's text stays left-aligned
169
- in its full-width cell, while the value shrinks to fit and
170
- right-aligns. Visually reads as a "[name ........ value]" row. */
171
158
  :where(.ui-value) {
172
159
  grid-row: 1;
173
160
  justify-self: end;
@@ -238,11 +225,9 @@
238
225
  /* Track */
239
226
  &::-webkit-slider-runnable-track {
240
227
  appearance: none;
241
- background: linear-gradient(
242
- to right,
243
- var(--_track-fill-color) var(--_track-fill, 0%),
244
- var(--_track-color) 0%
245
- );
228
+ background: linear-gradient(to right,
229
+ var(--_track-fill-color) var(--_track-fill, 0%),
230
+ var(--_track-color) 0%);
246
231
  block-size: var(--_track-height);
247
232
  border-radius: var(--_track-radius);
248
233
  }
@@ -268,8 +253,7 @@
268
253
  block-size: var(--_thumb-size);
269
254
  border: 3px solid var(--surface-default);
270
255
  border-radius: 50%;
271
- box-shadow: 0 0 0 var(--_thumb-highlight-size)
272
- var(--_thumb-highlight-color);
256
+ box-shadow: 0 0 0 var(--_thumb-highlight-size) var(--_thumb-highlight-color);
273
257
  cursor: ew-resize;
274
258
  inline-size: var(--_thumb-size);
275
259
  margin-block-start: var(--_thumb-offset);
@@ -287,8 +271,7 @@
287
271
  block-size: var(--_thumb-size);
288
272
  border: 3px solid var(--surface-default);
289
273
  border-radius: 50%;
290
- box-shadow: 0 0 0 var(--_thumb-highlight-size)
291
- var(--_thumb-highlight-color);
274
+ box-shadow: 0 0 0 var(--_thumb-highlight-size) var(--_thumb-highlight-color);
292
275
  cursor: ew-resize;
293
276
  inline-size: var(--_thumb-size);
294
277
  margin-block-start: var(--_thumb-offset);
@@ -313,10 +296,8 @@
313
296
 
314
297
  &:active {
315
298
  --_thumb-highlight-size: var(--size-2);
316
- --_track-color: light-dark(
317
- oklch(from var(--field-border-color) calc(l * 0.9) c h),
318
- oklch(from var(--field-border-color) calc(l * 1.1) c h)
319
- );
299
+ --_track-color: light-dark(oklch(from var(--field-border-color) calc(l * 0.9) c h),
300
+ oklch(from var(--field-border-color) calc(l * 1.1) c h));
320
301
  }
321
302
  }
322
303
 
@@ -38,11 +38,10 @@
38
38
  transform: scale(0.9);
39
39
  }
40
40
 
41
- transition:
42
- display calc(0.2s * var(--_motion)) allow-discrete,
43
- opacity calc(0.2s * var(--_motion)) var(--ease-3),
44
- overlay calc(0.2s * var(--_motion)) allow-discrete,
45
- scale calc(0.2s * var(--_motion)) var(--ease-3);
41
+ transition: display calc(0.2s * var(--_motion)) allow-discrete,
42
+ opacity calc(0.2s * var(--_motion)) var(--ease-3),
43
+ overlay calc(0.2s * var(--_motion)) allow-discrete,
44
+ scale calc(0.2s * var(--_motion)) var(--ease-3);
46
45
  }
47
46
 
48
47
  /* Animation off-stage styles */
@@ -75,10 +74,8 @@
75
74
  [role="group"] {
76
75
  label {
77
76
  background-color: light-dark(var(--gray-3), var(--gray-13));
78
- color: light-dark(
79
- oklch(from var(--text-primary) calc(l * 0.75) c h),
80
- oklch(from var(--text-primary) calc(l * 1.25) c h)
81
- );
77
+ color: light-dark(oklch(from var(--text-primary) calc(l * 0.75) c h),
78
+ oklch(from var(--text-primary) calc(l * 1.25) c h));
82
79
  font-weight: 500;
83
80
  overflow: hidden;
84
81
  padding-inline: var(--size-2);
@@ -101,6 +98,7 @@
101
98
 
102
99
  /* Option */
103
100
  option {
101
+
104
102
  /* Checkmark */
105
103
  /* TODO - checkmark should be the final version of the checkmark API. Follow the development of this and remove redundant psuedo stuff. */
106
104
  &::check {
@@ -123,6 +121,7 @@
123
121
  }
124
122
 
125
123
  :where(.ui-select:has(select)) {
124
+
126
125
  /* Size */
127
126
  &.ui-small {
128
127
  button {
@@ -102,7 +102,6 @@
102
102
  }
103
103
  }
104
104
 
105
- /* Severity icons via CSS data URIs — keeps icon assets out of JS strings. */
106
105
  &[data-severity="success"] .ui-icon {
107
106
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/><path d='m9 11 3 3L22 4'/></svg>");
108
107
  }
@@ -132,8 +131,6 @@
132
131
  }
133
132
  }
134
133
 
135
- /* Identity keyframe — only purpose is to delay the exit animation by the
136
- author-defined duration. */
137
134
  @keyframes toast-hold {
138
135
  from {
139
136
  opacity: 1;
@@ -4,7 +4,7 @@
4
4
  --_tooltip-color: light-dark(var(--gray-1), var(--gray-15));
5
5
  --_tooltip-offset: var(--size-2);
6
6
 
7
- & > .ui-anchor-floating {
7
+ &>.ui-anchor-floating {
8
8
  background-color: var(--_tooltip-bg);
9
9
  border-radius: var(--radius-2);
10
10
  color: var(--_tooltip-color);
@@ -26,18 +26,16 @@
26
26
  text-wrap: pretty;
27
27
  }
28
28
 
29
- /* Optional arrow pointing from the tooltip toward the trigger.
30
- Anchored to the same --anchor so it flips together with the
31
- tooltip when position-try-fallbacks kicks in. */
29
+ /* Arrow */
32
30
  &.ui-with-arrow {
33
31
  --_arrow-size: var(--size-2);
34
32
 
35
- & > .ui-anchor-floating {
36
- /* Reserve space so the arrow doesn't overlap the trigger. */
33
+ &>.ui-anchor-floating {
34
+ /* Offset so the arrow doesn't overlap the trigger. */
37
35
  --_tooltip-offset: calc(var(--size-2) + var(--_arrow-size) / 2);
38
36
  }
39
37
 
40
- & > .ui-anchor-floating::before {
38
+ &>.ui-anchor-floating::before {
41
39
  background-color: var(--_tooltip-bg);
42
40
  block-size: var(--_arrow-size);
43
41
  content: "";
@@ -51,7 +49,7 @@
51
49
  }
52
50
 
53
51
  /* Fade */
54
- & > .ui-anchor-floating[popover] {
52
+ &>.ui-anchor-floating[popover] {
55
53
  opacity: 0;
56
54
  transition:
57
55
  display 0.15s allow-discrete,
@@ -53,10 +53,8 @@
53
53
 
54
54
  /** Overline */
55
55
  :where(.ui-overline) {
56
- color: light-dark(
57
- oklch(from var(--text-muted) calc(l * 1.25) c h),
58
- oklch(from var(--text-muted) calc(l * 0.75) c h)
59
- );
56
+ color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
57
+ oklch(from var(--text-muted) calc(l * 0.75) c h));
60
58
  font-size: var(--font-size-0);
61
59
  font-weight: 500;
62
60
  letter-spacing: 0.06em;
@@ -64,20 +62,18 @@
64
62
  }
65
63
 
66
64
  :where(.ui-hgroup) {
67
- & > p {
65
+ &>p {
68
66
  margin: 0;
69
67
  }
70
68
 
71
- & > :where(h1, h2, h3, h4, h5, h6) {
69
+ &> :where(h1, h2, h3, h4, h5, h6) {
72
70
  margin-block: 0 0.4em;
73
71
  }
74
72
 
75
73
  /* First p element (overline) */
76
- & > p:first-of-type:first-child {
77
- color: light-dark(
78
- oklch(from var(--text-muted) calc(l * 1.25) c h),
79
- oklch(from var(--text-muted) calc(l * 0.75) c h)
80
- );
74
+ &>p:first-of-type:first-child {
75
+ color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
76
+ oklch(from var(--text-muted) calc(l * 0.75) c h));
81
77
  font-size: var(--font-size-0);
82
78
  font-weight: 500;
83
79
  letter-spacing: 0.06em;
@@ -85,13 +81,13 @@
85
81
  }
86
82
 
87
83
  /* Body paragraphs after the heading */
88
- & > p:not(:first-of-type:first-child) {
84
+ &>p:not(:first-of-type:first-child) {
89
85
  color: oklch(from currentColor l c h / 75%);
90
86
  font-size: var(--font-size-3);
91
87
  line-height: 1.6;
92
88
  }
93
89
 
94
- & > p + p {
90
+ &>p+p {
95
91
  margin-block-start: 0.75em;
96
92
  }
97
93
  }
@@ -103,7 +99,7 @@
103
99
  line-height: 1.6;
104
100
  }
105
101
 
106
- /* Inline text elements — class utilities (work anywhere) */
102
+ /* Inline text elements - class utilities */
107
103
  :where(.ui-u, .ui-abbr, .ui-dfn) {
108
104
  text-decoration: underline;
109
105
  text-underline-offset: 1px;
@@ -228,7 +224,7 @@
228
224
  scrollbar-width: thin;
229
225
  white-space: pre;
230
226
 
231
- > code {
227
+ >code {
232
228
  background: none;
233
229
  border-radius: 0;
234
230
  color: inherit;
@@ -254,6 +250,7 @@
254
250
  text-underline-offset: 2px;
255
251
 
256
252
  &[href] {
253
+
257
254
  &:hover,
258
255
  &:focus-visible {
259
256
  color: var(--primary-light);
@@ -303,7 +300,7 @@
303
300
  overflow-x: auto;
304
301
  scrollbar-width: thin;
305
302
 
306
- > code {
303
+ >code {
307
304
  background: none;
308
305
  border-radius: 0;
309
306
  color: inherit;
@@ -327,7 +324,7 @@
327
324
  font-weight: 700;
328
325
  text-wrap: pretty;
329
326
 
330
- & + *:not(&) {
327
+ &+*:not(&) {
331
328
  margin-block-start: 0;
332
329
  }
333
330
  }
@@ -374,10 +371,8 @@
374
371
 
375
372
  /** Overline */
376
373
  :is(.ui-overline, hgroup p:first-of-type:first-child) {
377
- color: light-dark(
378
- oklch(from var(--text-muted) calc(l * 1.25) c h),
379
- oklch(from var(--text-muted) calc(l * 0.75) c h)
380
- );
374
+ color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
375
+ oklch(from var(--text-muted) calc(l * 0.75) c h));
381
376
  font-size: var(--font-size-0);
382
377
  font-weight: 500;
383
378
  letter-spacing: 0.06em;
@@ -385,26 +380,26 @@
385
380
  }
386
381
 
387
382
  hgroup {
388
- & > p {
383
+ &>p {
389
384
  margin: 0;
390
385
  }
391
386
 
392
- & > :where(h1, h2, h3, h4, h5, h6) {
387
+ &> :where(h1, h2, h3, h4, h5, h6) {
393
388
  margin-block: 0 0.4em;
394
389
  }
395
390
 
396
- & + * {
391
+ &+* {
397
392
  margin-block-start: 3em;
398
393
  }
399
394
 
400
395
  /* Body paragraphs after the heading */
401
- & > p:not(:first-of-type:first-child) {
396
+ &>p:not(:first-of-type:first-child) {
402
397
  color: oklch(from currentColor l c h / 75%);
403
398
  font-size: var(--font-size-3);
404
399
  line-height: 1.6;
405
400
  }
406
401
 
407
- & > p + p {
402
+ &>p+p {
408
403
  margin-block-start: 0.75em;
409
404
  }
410
405
  }
@@ -466,7 +461,7 @@
466
461
  margin-block: var(--size-7);
467
462
  place-items: center;
468
463
 
469
- & > * {
464
+ &>* {
470
465
  margin-block: 0;
471
466
  }
472
467
 
@@ -477,18 +472,18 @@
477
472
  }
478
473
 
479
474
  /* Remove top margin from first child */
480
- & > :first-child {
475
+ &> :first-child {
481
476
  margin-block-start: 0;
482
477
  }
483
478
 
484
479
  /* Remove bottom margin from last child */
485
- & > :last-child {
480
+ &> :last-child {
486
481
  margin-block-end: 0;
487
482
  }
488
483
 
489
484
  /* Horizontal rules */
490
485
  hr {
491
- & + * {
486
+ &+* {
492
487
  margin-block-start: 0;
493
488
  }
494
489
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Checkbox runtime helpers.
3
3
  *
4
- * `indeterminate` is a JavaScript-only property on HTMLInputElement — the
4
+ * `indeterminate` is a JavaScript-only property on HTMLInputElement - the
5
5
  * attribute alone has no effect. We mark inputs with `data-indeterminate` at
6
6
  * render time and apply the property here, both on initial load and after
7
7
  * Astro's view transitions swap the DOM.
package/css/theme.css CHANGED
@@ -1,4 +1,5 @@
1
1
  @layer theme {
2
+
2
3
  /* 1. Color scheme */
3
4
  .ui-light {
4
5
  --color-scheme: light;
@@ -22,15 +23,13 @@
22
23
  --gray-chroma: 0.01;
23
24
  */
24
25
 
25
- /* 3. Named colors (no severity meaning) — use when you literally want a green/red/etc. dot */
26
+ /* 3. Named colors (no severity meaning) - use when you literally want a green/red/etc. dot */
26
27
  --blue: oklch(from var(--color-9) l 0.2 210);
27
28
  --green: oklch(from var(--color-9) l 0.2 145);
28
29
  --orange: oklch(from var(--color-7) l 0.2 75);
29
30
  --red: oklch(from var(--color-9) l 0.2 25);
30
31
 
31
- /* 4. Intent tokens
32
- Severity (have scope classes below): --success, --info, --warning, --critical
33
- Non-severity (value-only): --primary, --neutral */
32
+ /* 4. Intent tokens */
34
33
  --success: var(--green);
35
34
  --info: var(--blue);
36
35
  --warning: var(--orange);
@@ -77,7 +76,7 @@
77
76
  /* Sneaking in an extra font size I want but Open Props doesn't provide. You can do whatever you want with your own theme. It's just CSS. */
78
77
  --font-size-05: 0.875rem;
79
78
 
80
- /* 11. Control sizes — shared scale for fields and buttons so they line up. */
79
+ /* 11. Control sizes - shared scale for fields and buttons so they line up. */
81
80
  --control-size-x-small: 28px;
82
81
  --control-size-small: 32px;
83
82
  --control-size: 40px;