hydrateless 0.7.0 → 0.9.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 (45) hide show
  1. package/README.md +120 -0
  2. package/dist/accordion.css +20 -8
  3. package/dist/alert.css +15 -7
  4. package/dist/avatar.css +8 -14
  5. package/dist/badge.css +9 -1
  6. package/dist/breadcrumb.css +7 -3
  7. package/dist/button.css +48 -28
  8. package/dist/card.css +8 -5
  9. package/dist/checkbox.css +31 -22
  10. package/dist/combobox.css +43 -15
  11. package/dist/command-palette.css +123 -0
  12. package/dist/components.css +1127 -532
  13. package/dist/disclosure.css +35 -12
  14. package/dist/drawer.css +76 -48
  15. package/dist/dropdown.css +82 -22
  16. package/dist/field.css +5 -4
  17. package/dist/hydrateless.css +1359 -1282
  18. package/dist/hydrateless.min.css +1 -1
  19. package/dist/input.css +20 -17
  20. package/dist/kbd.css +4 -3
  21. package/dist/menu.css +107 -28
  22. package/dist/modal.css +63 -14
  23. package/dist/pagination.css +20 -11
  24. package/dist/popover.css +34 -12
  25. package/dist/progress.css +23 -12
  26. package/dist/{radio.css → radio-group.css} +23 -16
  27. package/dist/reset.css +7 -2
  28. package/dist/{segmented.css → segmented-control.css} +21 -10
  29. package/dist/select.css +28 -22
  30. package/dist/separator.css +9 -9
  31. package/dist/skeleton.css +18 -10
  32. package/dist/skip-link.css +13 -8
  33. package/dist/slider.css +28 -25
  34. package/dist/spinner.css +17 -14
  35. package/dist/switch.css +55 -18
  36. package/dist/table.css +52 -15
  37. package/dist/tabs.css +35 -11
  38. package/dist/textarea.css +26 -12
  39. package/dist/theme.css +5 -24
  40. package/dist/toast.css +40 -36
  41. package/dist/toc.css +17 -4
  42. package/dist/tokens.css +208 -179
  43. package/dist/tooltip.css +45 -15
  44. package/package.json +4 -4
  45. package/dist/command.css +0 -102
@@ -1,18 +1,23 @@
1
+ /**
2
+ * Skip link: `<a class="hl-skip-link" href="#main">Skip to content</a>` placed
3
+ * first in the body. Visually hidden until it receives keyboard focus, then
4
+ * pinned to the start corner of the viewport. Pure CSS; there is no enhancer.
5
+ */
1
6
  @layer components {
2
7
  .hl-skip-link {
3
8
  position: absolute;
4
- left: -9999px;
5
- top: auto;
6
- width: 1px;
7
- height: 1px;
9
+ inset-inline-start: -9999px;
10
+ inset-block-start: auto;
11
+ inline-size: 1px;
12
+ block-size: 1px;
8
13
  overflow: hidden;
9
14
  }
10
15
 
11
16
  .hl-skip-link:focus-visible {
12
- left: 0;
13
- top: 0;
14
- width: auto;
15
- height: auto;
17
+ inset-inline-start: 0;
18
+ inset-block-start: 0;
19
+ inline-size: auto;
20
+ block-size: auto;
16
21
  padding: var(--hl-space-2) var(--hl-space-3);
17
22
  background: var(--hl-fg);
18
23
  color: var(--hl-surface);
package/dist/slider.css CHANGED
@@ -1,60 +1,55 @@
1
1
  /**
2
2
  * Slider: native `<input type="range" class="hl-slider">`. Restyled track and
3
- * thumb across WebKit/Blink and Firefox while keeping native keyboard support.
3
+ * thumb across WebKit/Blink and Firefox while keeping native keyboard support
4
+ * and RTL direction. Pure CSS; there is no enhancer.
4
5
  */
5
6
  @layer components {
6
7
  .hl-slider {
7
8
  --_track: 0.375rem;
8
9
  --_thumb: 1.15rem;
9
10
 
10
- -webkit-appearance: none;
11
-
12
- -moz-appearance: none;
13
-
14
- appearance: none;
15
- width: 100%;
16
- height: 1.15rem;
17
- height: var(--_thumb);
11
+ appearance: none;
12
+ inline-size: 100%;
13
+ block-size: var(--_thumb);
18
14
  margin: 0;
19
15
  background: transparent;
20
16
  cursor: pointer;
21
17
  }
22
18
 
23
19
  .hl-slider::-webkit-slider-runnable-track {
24
- height: var(--_track);
20
+ block-size: var(--_track);
25
21
  border-radius: var(--hl-radius-full);
26
22
  background: var(--hl-surface-3);
27
23
  }
28
24
 
29
25
  .hl-slider::-moz-range-track {
30
- height: var(--_track);
26
+ block-size: var(--_track);
31
27
  border-radius: var(--hl-radius-full);
32
28
  background: var(--hl-surface-3);
33
29
  }
34
30
 
35
31
  .hl-slider::-moz-range-progress {
36
- height: var(--_track);
32
+ block-size: var(--_track);
37
33
  border-radius: var(--hl-radius-full);
38
34
  background: var(--hl-primary);
39
35
  }
40
36
 
41
37
  .hl-slider::-webkit-slider-thumb {
42
- -webkit-appearance: none;
43
- appearance: none;
44
- width: var(--_thumb);
45
- height: var(--_thumb);
46
- margin-top: calc((var(--_track) - var(--_thumb)) / 2);
38
+ appearance: none;
39
+ inline-size: var(--_thumb);
40
+ block-size: var(--_thumb);
41
+ margin-block-start: calc((var(--_track) - var(--_thumb)) / 2);
47
42
  border: 2px solid var(--hl-surface);
48
43
  border-radius: var(--hl-radius-full);
49
44
  background: var(--hl-primary);
50
45
  box-shadow: var(--hl-shadow-sm);
51
- -webkit-transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
52
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
46
+ -webkit-transition: scale var(--hl-duration-fast) var(--hl-ease-standard);
47
+ transition: scale var(--hl-duration-fast) var(--hl-ease-standard);
53
48
  }
54
49
 
55
50
  .hl-slider::-moz-range-thumb {
56
- width: var(--_thumb);
57
- height: var(--_thumb);
51
+ inline-size: var(--_thumb);
52
+ block-size: var(--_thumb);
58
53
  border: 2px solid var(--hl-surface);
59
54
  border-radius: var(--hl-radius-full);
60
55
  background: var(--hl-primary);
@@ -62,7 +57,7 @@
62
57
  }
63
58
 
64
59
  .hl-slider:active::-webkit-slider-thumb {
65
- transform: scale(1.1);
60
+ scale: 1.1;
66
61
  }
67
62
 
68
63
  .hl-slider:focus-visible {
@@ -70,15 +65,23 @@
70
65
  }
71
66
 
72
67
  .hl-slider:focus-visible::-webkit-slider-thumb {
73
- box-shadow: 0 0 0 4px color-mix(in oklab, var(--hl-ring) 35%, transparent);
68
+ box-shadow: var(--hl-focus-shadow);
74
69
  }
75
70
 
76
71
  .hl-slider:focus-visible::-moz-range-thumb {
77
- box-shadow: 0 0 0 4px color-mix(in oklab, var(--hl-ring) 35%, transparent);
72
+ box-shadow: var(--hl-focus-shadow);
78
73
  }
79
74
 
80
75
  .hl-slider:disabled {
81
76
  cursor: not-allowed;
82
- opacity: 0.6;
77
+ opacity: var(--hl-disabled-opacity);
78
+ }
79
+
80
+ /* Shadows vanish in forced colors, so focus falls back to an outline. */
81
+ @media (forced-colors: active) {
82
+ .hl-slider:focus-visible {
83
+ outline: var(--hl-focus-ring);
84
+ outline-offset: var(--hl-focus-offset);
85
+ }
83
86
  }
84
87
  }
package/dist/spinner.css CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Spinner: `<span class="hl-spinner" role="status" aria-label="Loading">`.
3
- * Inherits `currentColor`, so set `color` to theme it.
3
+ * Inherits `currentColor`, so set `color` to theme it. Pure CSS; there is no
4
+ * enhancer.
4
5
  * data-hl-size: sm | md (default) | lg | xl
5
6
  */
6
7
  @layer components {
@@ -10,22 +11,14 @@
10
11
 
11
12
  display: inline-block;
12
13
  flex: none;
13
- width: 1.25rem;
14
- width: var(--_size);
15
- height: 1.25rem;
16
- height: var(--_size);
17
- border: 2px solid color-mix(in oklab, currentcolor 25%, transparent);
18
- border-top-color: currentcolor;
14
+ inline-size: var(--_size);
15
+ block-size: var(--_size);
16
+ border: var(--_width) solid color-mix(in oklab, currentcolor 25%, transparent);
17
+ border-block-start-color: currentcolor;
19
18
  border-radius: var(--hl-radius-full);
20
19
  animation: hl-spinner-rotate 0.6s linear infinite;
21
20
  }
22
21
 
23
- @supports (color: color-mix(in lch, red, blue)) {
24
- .hl-spinner {
25
- border: var(--_width) solid color-mix(in oklab, currentcolor 25%, transparent);
26
- }
27
- }
28
-
29
22
  .hl-spinner[data-hl-size='sm'] {
30
23
  --_size: 1rem;
31
24
  }
@@ -46,9 +39,19 @@
46
39
  }
47
40
  }
48
41
 
42
+ /* A static arc still reads as "loading" without continuous motion. */
49
43
  @media (prefers-reduced-motion: reduce) {
50
44
  .hl-spinner {
51
- animation-duration: 1.4s;
45
+ animation: none;
46
+ }
47
+ }
48
+
49
+ /* The faded ring is color-mixed, which forced colors flatten; keep the arc
50
+ visible by drawing the rest of the ring in GrayText. */
51
+ @media (forced-colors: active) {
52
+ .hl-spinner {
53
+ border-color: GrayText;
54
+ border-block-start-color: CanvasText;
52
55
  }
53
56
  }
54
57
  }
package/dist/switch.css CHANGED
@@ -1,39 +1,53 @@
1
+ /**
2
+ * Switch: `<label data-hl-switch><input type="checkbox" role="switch"> Label</label>`.
3
+ * The native checkbox is restyled as a track and thumb, so state, keyboard,
4
+ * and form submission stay native. Pure CSS; there is no enhancer.
5
+ * data-hl-switch: the label wrapper
6
+ */
1
7
  @layer components {
2
8
  [data-hl-switch] {
9
+ --_track-inline: 2.25rem;
10
+ --_track-block: 1.25rem;
11
+ --_gap: 2px;
12
+ --_thumb: calc(var(--_track-block) - var(--_gap) * 2);
13
+ --_travel: calc(var(--_track-inline) - var(--_track-block));
14
+
3
15
  display: inline-flex;
4
16
  align-items: center;
5
17
  gap: var(--hl-space-2);
6
18
  }
7
19
 
8
20
  [data-hl-switch] input[type='checkbox'] {
9
- -webkit-appearance: none;
10
- -moz-appearance: none;
11
- appearance: none;
12
- width: 2.25rem;
13
- height: 1.25rem;
14
- border-radius: 1.25rem;
15
- background: var(--hl-border-strong);
21
+ appearance: none;
16
22
  position: relative;
17
- outline-offset: 2px;
23
+ inline-size: var(--_track-inline);
24
+ block-size: var(--_track-block);
25
+ margin: 0;
26
+ border-radius: var(--hl-radius-full);
27
+ background: var(--hl-border-strong);
18
28
  transition: background-color var(--hl-duration-fast) var(--hl-ease-standard);
19
29
  }
20
30
 
31
+ /* The thumb rests at the inline start and travels toward the inline end,
32
+ so it is placed logically and slides left under RTL. */
21
33
  [data-hl-switch] input[type='checkbox']::after {
22
34
  content: '';
23
35
  position: absolute;
24
- top: 2px;
25
- right: auto;
26
- bottom: auto;
27
- left: 2px;
28
- width: calc(1.25rem - 4px);
29
- height: calc(1.25rem - 4px);
30
- border-radius: 50%;
36
+ inset-block-start: var(--_gap);
37
+ inset-inline-start: var(--_gap);
38
+ inline-size: var(--_thumb);
39
+ block-size: var(--_thumb);
40
+ border-radius: var(--hl-radius-full);
31
41
  background: var(--hl-surface);
32
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
42
+ transition: translate var(--hl-duration-fast) var(--hl-ease-standard);
33
43
  }
34
44
 
35
45
  [data-hl-switch] input[type='checkbox']:checked::after {
36
- transform: translateX(1rem);
46
+ translate: var(--_travel) 0;
47
+ }
48
+
49
+ [data-hl-switch] input[type='checkbox']:checked:dir(rtl)::after {
50
+ translate: calc(var(--_travel) * -1) 0;
37
51
  }
38
52
 
39
53
  [data-hl-switch] input[type='checkbox']:checked {
@@ -42,10 +56,11 @@
42
56
 
43
57
  [data-hl-switch] input[type='checkbox']:focus-visible {
44
58
  outline: var(--hl-focus-ring);
59
+ outline-offset: var(--hl-focus-offset);
45
60
  }
46
61
 
47
62
  [data-hl-switch] input[type='checkbox']:disabled {
48
- opacity: 0.5;
63
+ opacity: var(--hl-disabled-opacity);
49
64
  cursor: not-allowed;
50
65
  }
51
66
 
@@ -53,4 +68,26 @@
53
68
  opacity: 0.7;
54
69
  cursor: not-allowed;
55
70
  }
71
+
72
+ /* The track needs an edge once its fill is flattened, and the custom-drawn
73
+ thumb keeps its own colors so it stays visible on both states. */
74
+ @media (forced-colors: active) {
75
+ [data-hl-switch] input[type='checkbox'] {
76
+ border: var(--hl-border-width) solid ButtonBorder;
77
+ }
78
+
79
+ [data-hl-switch] input[type='checkbox']:checked {
80
+ background: Highlight;
81
+ border-color: Highlight;
82
+ }
83
+
84
+ [data-hl-switch] input[type='checkbox']::after {
85
+ forced-color-adjust: none;
86
+ background: ButtonText;
87
+ }
88
+
89
+ [data-hl-switch] input[type='checkbox']:checked::after {
90
+ background: HighlightText;
91
+ }
92
+ }
56
93
  }
package/dist/table.css CHANGED
@@ -1,31 +1,42 @@
1
1
  /**
2
- * Table: `<table class="hl-table">`. Semantic table styling with optional
3
- * zebra striping and hover.
2
+ * Table: `<table class="hl-table">`, optionally inside
3
+ * `<div class="hl-table-wrapper">` so wide tables scroll instead of breaking
4
+ * the layout. Pure CSS; there is no enhancer.
4
5
  * data-hl-striped: zebra rows
5
6
  * data-hl-hover: highlight row on hover
7
+ * data-hl-align: start (default) | center | end, on the table or a cell
8
+ * data-hl-size: sm | md (default) | lg, cell padding density
6
9
  */
7
10
  @layer components {
11
+ .hl-table-wrapper {
12
+ inline-size: 100%;
13
+ overflow-x: auto;
14
+ overscroll-behavior-x: contain;
15
+ }
16
+
8
17
  .hl-table {
9
- width: 100%;
18
+ --_pad-y: var(--hl-space-2);
19
+ --_pad-x: var(--hl-space-3);
20
+
21
+ inline-size: 100%;
10
22
  border-collapse: collapse;
11
23
  font-size: var(--hl-text-sm);
12
24
  color: var(--hl-fg);
13
25
  }
14
26
 
15
27
  .hl-table caption {
16
- padding-top: var(--hl-space-2);
17
- padding-bottom: var(--hl-space-2);
28
+ padding-block: var(--hl-space-2);
18
29
  color: var(--hl-fg-muted);
19
- text-align: left;
30
+ text-align: start;
20
31
  caption-side: bottom;
21
32
  }
22
33
 
23
34
  .hl-table th,
24
35
  .hl-table td {
25
- padding: var(--hl-space-2) var(--hl-space-3);
26
- text-align: left;
36
+ padding: var(--_pad-y) var(--_pad-x);
37
+ text-align: start;
27
38
  vertical-align: middle;
28
- border-bottom: var(--hl-border-width) solid var(--hl-border);
39
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
29
40
  }
30
41
 
31
42
  .hl-table thead th {
@@ -34,7 +45,7 @@
34
45
  text-transform: uppercase;
35
46
  letter-spacing: 0.03em;
36
47
  color: var(--hl-fg-muted);
37
- border-bottom-color: var(--hl-border-strong);
48
+ border-block-end-color: var(--hl-border-strong);
38
49
  }
39
50
 
40
51
  .hl-table tfoot td {
@@ -50,13 +61,39 @@
50
61
  background: color-mix(in oklab, var(--hl-primary) 8%, transparent);
51
62
  }
52
63
 
53
- .hl-table td[data-hl-align='end'],
54
- .hl-table th[data-hl-align='end'] {
55
- text-align: right;
64
+ .hl-table[data-hl-size='sm'] {
65
+ --_pad-y: var(--hl-space-1);
66
+ --_pad-x: var(--hl-space-2);
67
+
68
+ font-size: var(--hl-text-xs);
69
+ }
70
+
71
+ .hl-table[data-hl-size='lg'] {
72
+ --_pad-y: var(--hl-space-3);
73
+ --_pad-x: var(--hl-space-4);
74
+
75
+ font-size: var(--hl-text-base);
76
+ }
77
+
78
+ .hl-table[data-hl-align='start'] :is(th, td),
79
+ .hl-table :is(th, td)[data-hl-align='start'] {
80
+ text-align: start;
56
81
  }
57
82
 
58
- .hl-table td[data-hl-align='center'],
59
- .hl-table th[data-hl-align='center'] {
83
+ .hl-table[data-hl-align='center'] :is(th, td),
84
+ .hl-table :is(th, td)[data-hl-align='center'] {
60
85
  text-align: center;
61
86
  }
87
+
88
+ .hl-table[data-hl-align='end'] :is(th, td),
89
+ .hl-table :is(th, td)[data-hl-align='end'] {
90
+ text-align: end;
91
+ }
92
+
93
+ @media (forced-colors: active) {
94
+ .hl-table[data-hl-hover] tbody tr:hover {
95
+ background: Highlight;
96
+ color: HighlightText;
97
+ }
98
+ }
62
99
  }
package/dist/tabs.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Tabs. Two markups are supported and styled together:
2
+ * Tabs: `<div data-hl-tabs>`. Two markups are supported and styled together:
3
3
  *
4
4
  * - CSS-only baseline: `.hl-tablist` of `<label class="hl-tab">` wrapping a
5
5
  * radio, then a `.hl-tabpanels` of `.hl-tabpanel`s. `:has(input:checked)`
@@ -7,6 +7,10 @@
7
7
  * - Enhanced: the enhancer adds `role="tab"`/`tabpanel`, roving focus, and
8
8
  * `aria-selected`, toggles `[hidden]` on panels, and marks the root
9
9
  * `data-hl-ready`, at which point the no-JS rules below stand down.
10
+ * data-hl-tabs: root
11
+ * data-hl-ready: set by the enhancer
12
+ * `aria-orientation="vertical"` on the tablist stacks the tabs at the
13
+ * inline start of the panels.
10
14
  */
11
15
  @layer components {
12
16
  [data-hl-tabs] {
@@ -19,15 +23,23 @@
19
23
  display: flex;
20
24
  gap: var(--hl-space-2);
21
25
  padding: var(--hl-space-2);
22
- border-bottom: var(--hl-border-width) solid var(--hl-border);
26
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
27
+ }
28
+
29
+ [data-hl-tabs]:has(> [role='tablist'][aria-orientation='vertical']) {
30
+ display: flex;
31
+ }
32
+
33
+ [data-hl-tabs] [role='tablist'][aria-orientation='vertical'] {
34
+ flex-direction: column;
35
+ border-block-end: 0;
36
+ border-inline-end: var(--hl-border-width) solid var(--hl-border);
23
37
  }
24
38
 
25
39
  .hl-tab,
26
40
  [data-hl-tabs] [role='tab'] {
27
41
  position: relative;
28
- -webkit-appearance: none;
29
- -moz-appearance: none;
30
- appearance: none;
42
+ appearance: none;
31
43
  display: inline-flex;
32
44
  align-items: center;
33
45
  background: transparent;
@@ -42,10 +54,7 @@
42
54
  /* The baseline keeps selection in a visually hidden radio per tab label. */
43
55
  .hl-tab > input[type='radio'] {
44
56
  position: absolute;
45
- top: 0;
46
- right: 0;
47
- bottom: 0;
48
- left: 0;
57
+ inset: 0;
49
58
  margin: 0;
50
59
  opacity: 0;
51
60
  cursor: pointer;
@@ -59,13 +68,13 @@
59
68
  .hl-tab:has(input:focus-visible),
60
69
  [data-hl-tabs] [role='tab']:focus-visible {
61
70
  outline: var(--hl-focus-ring);
62
- outline-offset: 2px;
71
+ outline-offset: var(--hl-focus-offset);
63
72
  }
64
73
 
65
74
  .hl-tab:has(input:disabled),
66
75
  [data-hl-tabs] [role='tab'][disabled],
67
76
  [data-hl-tabs] [role='tab'][aria-disabled='true'] {
68
- opacity: 0.5;
77
+ opacity: var(--hl-disabled-opacity);
69
78
  cursor: not-allowed;
70
79
  }
71
80
 
@@ -124,4 +133,19 @@
124
133
  [data-hl-tabs]:not([data-hl-ready]) [role='tabpanel'] ~ [role='tabpanel'] {
125
134
  display: none;
126
135
  }
136
+
137
+ /* Selection is a fill, which forced colors flatten; use the system highlight
138
+ and give every tab an edge. */
139
+ @media (forced-colors: active) {
140
+ .hl-tab,
141
+ [data-hl-tabs] [role='tab'] {
142
+ border: var(--hl-border-width) solid ButtonBorder;
143
+ }
144
+
145
+ .hl-tab:has(input:checked),
146
+ [data-hl-tabs] [role='tab'][aria-selected='true'] {
147
+ background: Highlight;
148
+ color: HighlightText;
149
+ }
150
+ }
127
151
  }
package/dist/textarea.css CHANGED
@@ -1,12 +1,14 @@
1
1
  /**
2
- * Multi-line text input: `<textarea class="hl-textarea">`.
3
- * data-hl-invalid: error styling (pair with aria-invalid)
2
+ * Multi-line text input: `<textarea class="hl-textarea">`. Pure CSS; there is
3
+ * no enhancer.
4
+ * data-hl-invalid: error styling (pair with aria-invalid)
5
+ * data-hl-autosize: grows with its content where `field-sizing` is supported
4
6
  */
5
7
  @layer components {
6
8
  .hl-textarea {
7
9
  display: block;
8
- width: 100%;
9
- min-height: calc(var(--hl-control-height-md) * 2);
10
+ inline-size: 100%;
11
+ min-block-size: calc(var(--hl-control-height-md) * 2);
10
12
  padding: var(--hl-space-2) var(--hl-space-3);
11
13
  border: var(--hl-border-width) solid var(--hl-border-strong);
12
14
  border-radius: var(--hl-radius-md);
@@ -17,30 +19,27 @@
17
19
  line-height: var(--hl-leading-normal);
18
20
  resize: vertical;
19
21
  transition:
20
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
21
- }
22
-
23
- .hl-textarea::-moz-placeholder {
24
- color: var(--hl-fg-subtle);
22
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
23
+ box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
25
24
  }
26
25
 
27
26
  .hl-textarea::placeholder {
28
27
  color: var(--hl-fg-subtle);
29
28
  }
30
29
 
31
- .hl-textarea:hover:not(:disabled):not(:focus) {
30
+ .hl-textarea:hover:not(:disabled, :focus) {
32
31
  border-color: var(--hl-fg-subtle);
33
32
  }
34
33
 
35
34
  .hl-textarea:focus-visible {
36
35
  outline: none;
37
36
  border-color: var(--hl-ring);
38
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
37
+ box-shadow: var(--hl-focus-shadow);
39
38
  }
40
39
 
41
40
  .hl-textarea:disabled {
42
41
  cursor: not-allowed;
43
- opacity: 0.6;
42
+ opacity: var(--hl-disabled-opacity);
44
43
  background: var(--hl-surface-2);
45
44
  }
46
45
 
@@ -54,4 +53,19 @@
54
53
  border-color: var(--hl-danger);
55
54
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-danger) 30%, transparent);
56
55
  }
56
+
57
+ /* Native autosize; engines without it keep the fixed minimum and a resizer. */
58
+ @supports (field-sizing: content) {
59
+ .hl-textarea[data-hl-autosize] {
60
+ field-sizing: content;
61
+ max-block-size: 60vb;
62
+ }
63
+ }
64
+
65
+ @media (forced-colors: active) {
66
+ .hl-textarea:focus-visible {
67
+ outline: var(--hl-focus-ring);
68
+ outline-offset: var(--hl-focus-offset);
69
+ }
70
+ }
57
71
  }
package/dist/theme.css CHANGED
@@ -1,24 +1,9 @@
1
+ /**
2
+ * Theme: document-level defaults built on the semantic tokens. `color-scheme`
3
+ * and the `[data-theme]` switches live in tokens/semantic.css so this file
4
+ * only has to apply the resolved colors and type to the page.
5
+ */
1
6
  @layer theme {
2
- :root {
3
- --csstools-color-scheme--light: initial;
4
- color-scheme: light dark;
5
- }
6
- @media (prefers-color-scheme: dark) {
7
- :root {
8
- --csstools-color-scheme--light: ;
9
- }
10
- }
11
-
12
- [data-theme='light'] {
13
- --csstools-color-scheme--light: initial;
14
- color-scheme: light;
15
- }
16
-
17
- [data-theme='dark'] {
18
- --csstools-color-scheme--light: ;
19
- color-scheme: dark;
20
- }
21
-
22
7
  body {
23
8
  background-color: var(--hl-bg);
24
9
  color: var(--hl-fg);
@@ -28,10 +13,6 @@
28
13
  -webkit-font-smoothing: antialiased;
29
14
  }
30
15
 
31
- ::-moz-selection {
32
- background-color: color-mix(in oklab, var(--hl-primary) 30%, transparent);
33
- }
34
-
35
16
  ::selection {
36
17
  background-color: color-mix(in oklab, var(--hl-primary) 30%, transparent);
37
18
  }