hydrateless 0.8.0 → 0.10.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 +69 -8
  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 +36 -22
  10. package/dist/combobox.css +43 -15
  11. package/dist/command-palette.css +123 -0
  12. package/dist/components.css +1351 -571
  13. package/dist/disclosure.css +27 -29
  14. package/dist/drawer.css +76 -48
  15. package/dist/dropdown.css +138 -22
  16. package/dist/field.css +5 -4
  17. package/dist/hydrateless.css +1581 -1330
  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 +106 -45
  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} +24 -12
  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 +66 -25
  34. package/dist/spinner.css +17 -14
  35. package/dist/switch.css +55 -18
  36. package/dist/table.css +100 -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 -183
  43. package/dist/tooltip.css +74 -17
  44. package/package.json +4 -4
  45. package/dist/command.css +0 -102
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # hydrateless
2
+
3
+ Accessible, themeable UI primitives built on semantic HTML and modern CSS. This package is the CSS: every component works with no JavaScript, and the optional enhancers in `@hydrateless/enhancers` layer keyboard patterns and APIs on top of the same markup.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm install hydrateless
9
+ ```
10
+
11
+ ```html
12
+ <link rel="stylesheet" href="node_modules/hydrateless/dist/hydrateless.css" />
13
+ ```
14
+
15
+ Or from a CDN, pinned to a major:
16
+
17
+ ```html
18
+ <link rel="stylesheet" href="https://unpkg.com/hydrateless@0/dist/hydrateless.min.css" />
19
+ ```
20
+
21
+ ## Entry points
22
+
23
+ `hydrateless.css` bundles everything in four cascade layers, declared in this order so later layers always win:
24
+
25
+ ```css
26
+ @layer reset, tokens, theme, components;
27
+ ```
28
+
29
+ Each layer and each component is also a subpath export, so you can take only what you need. Always include `tokens.css`; the components reference the tokens and nothing else.
30
+
31
+ | Subpath | Contents |
32
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
33
+ | `hydrateless/reset.css` | Border-box sizing, zeroed margins, inherited form fonts |
34
+ | `hydrateless/tokens.css` | Palette, scales, and semantic tokens (`--hl-*`) |
35
+ | `hydrateless/theme.css` | Body colors and type built on the tokens |
36
+ | `hydrateless/components.css` | Every component below |
37
+ | `hydrateless/accordion.css`, `disclosure.css`, `tabs.css`, `toc.css`, `breadcrumb.css`, `pagination.css`, `separator.css` | Disclosure and navigation |
38
+ | `hydrateless/modal.css`, `drawer.css`, `popover.css`, `tooltip.css`, `dropdown.css`, `menu.css`, `toast.css`, `command-palette.css` | Overlays |
39
+ | `hydrateless/button.css`, `input.css`, `textarea.css`, `select.css`, `checkbox.css`, `radio-group.css`, `switch.css`, `field.css`, `combobox.css`, `segmented-control.css`, `slider.css` | Forms |
40
+ | `hydrateless/alert.css`, `badge.css`, `card.css`, `avatar.css`, `progress.css`, `spinner.css`, `skeleton.css`, `kbd.css`, `table.css` | Feedback and data display |
41
+ | `hydrateless/skip-link.css` | Navigation utility |
42
+
43
+ ```js
44
+ import 'hydrateless/tokens.css';
45
+ import 'hydrateless/button.css';
46
+ import 'hydrateless/segmented-control.css';
47
+ ```
48
+
49
+ Class names don't follow the file names one to one: `segmented-control.css` styles `.hl-segmented`, `radio-group.css` styles `.hl-radio-group` and `.hl-radio`, and `command-palette.css` styles `[data-hl-command]` and `.hl-command-*`.
50
+
51
+ ## Theming
52
+
53
+ Every color token is a `light-dark()` pair, resolved by `color-scheme`. The root follows the system preference; set `data-theme` on any element to pin a scheme for that subtree:
54
+
55
+ ```html
56
+ <html data-theme="dark">
57
+ ...
58
+ <aside data-theme="light">Always light</aside>
59
+ </html>
60
+ ```
61
+
62
+ Override tokens anywhere in the cascade; the components read only the semantic layer, so a brand swap is a handful of variables:
63
+
64
+ ```css
65
+ :root {
66
+ --hl-primary: light-dark(hsl(280deg 70% 45%), hsl(280deg 80% 65%));
67
+ --hl-primary-fg: white;
68
+ --hl-radius-md: 0.25rem;
69
+ }
70
+ ```
71
+
72
+ ### Token reference
73
+
74
+ Palette ramps (`--hl-gray-50` to `--hl-gray-950`, `--hl-brand-*`, `--hl-red-*`, `--hl-amber-*`, `--hl-green-*`, `--hl-sky-*`) live in `tokens/palette.css`. The tokens components actually use:
75
+
76
+ | Token | Purpose |
77
+ | ------------------------------------------------------------------------------- | --------------------------------------------------------------- |
78
+ | `--hl-bg`, `--hl-surface`, `--hl-surface-2`, `--hl-surface-3` | Page and stepped surfaces |
79
+ | `--hl-fg`, `--hl-fg-muted`, `--hl-fg-subtle` | Text |
80
+ | `--hl-border`, `--hl-border-strong`, `--hl-border-width`, `--hl-border-width-2` | Borders |
81
+ | `--hl-ring`, `--hl-focus-ring`, `--hl-focus-shadow`, `--hl-focus-offset` | Focus ring color, full outline value, soft halo, outline gap |
82
+ | `--hl-primary`, `--hl-danger`, `--hl-success`, `--hl-warning`, `--hl-info` | Intents, each with `-hover`, `-fg`, `-subtle`, `-subtle-fg` |
83
+ | `--hl-scrim`, `--hl-overlay`, `--hl-overlay-shadow` | Backdrop and floating surfaces |
84
+ | `--hl-shadow-xs` to `--hl-shadow-xl`, `--hl-shadow-color` | Elevation |
85
+ | `--hl-space-*`, `--hl-radius-*`, `--hl-text-*`, `--hl-leading-*`, `--hl-font-*` | Spacing, radii, and type scales |
86
+ | `--hl-control-block-size`, `--hl-control-height-sm`, `-md`, `-lg` | Control heights; `-md` is an alias of `--hl-control-block-size` |
87
+ | `--hl-overlay-inline-size`, `--hl-modal-inline-size` | Drawer and modal widths |
88
+ | `--hl-disabled-opacity` | Opacity of disabled controls and items |
89
+ | `--hl-z-*` | Stacking order for the JS positioning fallback |
90
+ | `--hl-duration-fast`, `-base`, `-slow`, `--hl-ease-standard`, `-emphasized` | Motion |
91
+
92
+ ## Conventions
93
+
94
+ State and variants are `data-hl-*` attributes rather than modifier classes:
95
+
96
+ - `data-hl-intent="primary | danger | success | warning | info | neutral"` on buttons, badges, alerts, progress, and toasts.
97
+ - `data-hl-variant="solid | soft | outline | ghost | link"` is the button's visual style (and `soft | solid | outline` on badges).
98
+ - `data-hl-size="sm | md | lg"` on controls, tables, and avatars.
99
+ - `data-hl-side="start | end"` on the drawer (default `end`). Sides are logical, so they flip under `dir="rtl"`.
100
+ - `data-hl-shape="text | circle | rect"` on skeletons.
101
+ - `data-hl-orientation` on radio groups and separators; `aria-orientation` on tablists and menus.
102
+ - `data-hl-ready` is set by an enhancer once it owns a component; the CSS no-JS baselines (menu submenus on hover, combobox list on focus, tab panels by radio, command palette empty state) stand down when it's present.
103
+
104
+ Modal and drawer selectors accept either the class or the data attribute: `:is(.hl-modal, dialog[data-hl-modal])` and `:is(.hl-drawer, dialog[data-hl-drawer])`.
105
+
106
+ ## Right to left
107
+
108
+ The stylesheet uses logical properties throughout (`inline-size`, `margin-inline-start`, `inset-inline-end`, `text-align: start`), so setting `dir="rtl"` mirrors every component. Transforms are physical, so the two places that move things, the switch thumb and the drawer slide, are mirrored with `:dir(rtl)`.
109
+
110
+ ## Motion
111
+
112
+ Overlays (popover, dropdown, menu submenus, tooltip, modal and its backdrop, drawer, toast) enter through `@starting-style` and exit through `transition-behavior: allow-discrete` on `display` and `overlay`, using the duration and easing tokens. Under `prefers-reduced-motion: reduce` the duration tokens drop to `0ms`, and the spinner, loading button, and indeterminate progress stop animating and render a static arc or bar.
113
+
114
+ ## Forced colors
115
+
116
+ Under `forced-colors: active` the semantic tokens map to system colors (`Canvas`, `CanvasText`, `Highlight`, `HighlightText`, `GrayText`), controls that normally rely on fills gain `ButtonBorder`/`CanvasText` borders, and selected tabs, segments, options, and checked switches use `Highlight`. Only the custom-drawn checkbox mark, radio dot, and switch thumb use `forced-color-adjust: none`.
117
+
118
+ ## Browser support
119
+
120
+ The CSS targets evergreen browsers with the Popover API, `:has()`, `light-dark()`, and `@starting-style`. CSS anchor positioning is used where available; the enhancers provide a JS positioning fallback elsewhere. The build (`scripts/build.mjs`) intentionally leaves these features native rather than polyfilling them.
@@ -1,18 +1,30 @@
1
+ /**
2
+ * Accordion: `<div data-hl-accordion>` of native `<details>` items, each with a
3
+ * `<summary>` header and an `.hl-accordion-panel` body.
4
+ *
5
+ * No-JS baseline: `<details>` opens and closes on its own; exclusive groups
6
+ * need only a shared `name` attribute. The enhancer adds arrow-key movement
7
+ * between headers and the value API, and reads nothing else from the markup.
8
+ * data-hl-accordion: root (opts into the enhancer)
9
+ */
1
10
  @layer components {
2
11
  [data-hl-accordion] {
3
- border: 1px solid var(--hl-border);
12
+ border: var(--hl-border-width) solid var(--hl-border);
4
13
  border-radius: var(--hl-radius-lg);
5
14
  }
6
15
 
7
16
  [data-hl-accordion] > details {
8
- border-top: 1px solid var(--hl-border);
17
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
9
18
  }
10
19
 
11
20
  [data-hl-accordion] > details:first-child {
12
- border-top: 0;
21
+ border-block-start: 0;
13
22
  }
14
23
 
15
24
  [data-hl-accordion] > details > summary {
25
+ display: flex;
26
+ align-items: center;
27
+ gap: var(--hl-space-2);
16
28
  list-style: none;
17
29
  cursor: pointer;
18
30
  padding: var(--hl-space-3) var(--hl-space-4);
@@ -24,18 +36,18 @@
24
36
 
25
37
  [data-hl-accordion] > details > summary:focus-visible {
26
38
  outline: var(--hl-focus-ring);
27
- outline-offset: 2px;
39
+ outline-offset: var(--hl-focus-offset);
28
40
  }
29
41
 
42
+ /* The chevron sits at the inline end so it lands on the left under RTL. */
30
43
  [data-hl-accordion] > details > summary::after {
31
44
  content: '\25BE';
32
- float: right;
33
- transform: rotate(0deg);
34
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
45
+ margin-inline-start: auto;
46
+ transition: rotate var(--hl-duration-fast) var(--hl-ease-standard);
35
47
  }
36
48
 
37
49
  [data-hl-accordion] > details[open] > summary::after {
38
- transform: rotate(180deg);
50
+ rotate: 180deg;
39
51
  }
40
52
 
41
53
  [data-hl-accordion] > details > .hl-accordion-panel {
package/dist/alert.css CHANGED
@@ -1,7 +1,12 @@
1
1
  /**
2
- * Alert: `<div class="hl-alert" role="alert" data-hl-intent="…">` with an
3
- * optional icon, `.hl-alert-title`, and body content.
4
- * data-hl-intent: info (default) | success | warning | danger | neutral
2
+ * Alert: `<div class="hl-alert" role="alert" data-hl-intent="...">` with an
3
+ * optional icon, `.hl-alert-title`, and body content. Add `data-hl-alert` and
4
+ * a `[data-hl-dismiss]` button for the dismiss enhancer, which fades the alert
5
+ * out (`data-hl-alert-closing`) before hiding it.
6
+ * data-hl-intent: info (default) | success | warning | danger | neutral
7
+ * data-hl-alert: opt in to the dismiss enhancer
8
+ * data-hl-dismiss: the dismiss button inside the alert
9
+ * data-hl-alert-closing: set by the enhancer during the exit transition
5
10
  */
6
11
  @layer components {
7
12
  .hl-alert {
@@ -13,12 +18,61 @@
13
18
  gap: var(--hl-space-3);
14
19
  padding: var(--hl-space-3) var(--hl-space-4);
15
20
  border: var(--hl-border-width) solid transparent;
16
- border-left: 3px solid var(--_accent);
21
+ border-inline-start: 3px solid var(--_accent);
17
22
  border-radius: var(--hl-radius-md);
18
23
  background: var(--_bg);
19
24
  color: var(--_fg);
20
25
  font-size: var(--hl-text-sm);
21
26
  line-height: var(--hl-leading-normal);
27
+ transition:
28
+ opacity var(--hl-duration-base) var(--hl-ease-standard),
29
+ translate var(--hl-duration-base) var(--hl-ease-standard);
30
+ }
31
+
32
+ .hl-alert[data-hl-alert-closing] {
33
+ opacity: 0;
34
+ translate: 0 -0.25rem;
35
+ }
36
+
37
+ /* `display: flex` above would otherwise beat the user agent's `[hidden]`. */
38
+ .hl-alert[hidden] {
39
+ display: none;
40
+ }
41
+
42
+ .hl-alert [data-hl-dismiss] {
43
+ display: inline-flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ flex: none;
47
+ inline-size: 1.5rem;
48
+ block-size: 1.5rem;
49
+ margin-inline-start: auto;
50
+ margin-block-start: -0.125rem;
51
+ padding: 0;
52
+ border: 0;
53
+ border-radius: var(--hl-radius-sm);
54
+ background: transparent;
55
+ color: inherit;
56
+ font: inherit;
57
+ line-height: 1;
58
+ cursor: pointer;
59
+ opacity: 0.7;
60
+ }
61
+
62
+ .hl-alert [data-hl-dismiss]:hover {
63
+ opacity: 1;
64
+ background: color-mix(in oklab, currentcolor 10%, transparent);
65
+ }
66
+
67
+ .hl-alert [data-hl-dismiss]:focus-visible {
68
+ outline: var(--hl-focus-ring);
69
+ outline-offset: var(--hl-focus-offset);
70
+ opacity: 1;
71
+ }
72
+
73
+ .hl-alert [data-hl-dismiss]:empty::before {
74
+ content: '\00D7';
75
+ font-size: var(--hl-text-lg);
22
76
  }
23
77
 
24
78
  .hl-alert[data-hl-intent='success'] {
@@ -47,9 +101,9 @@
47
101
 
48
102
  .hl-alert > svg:first-child {
49
103
  flex: none;
50
- width: 1.25rem;
51
- height: 1.25rem;
52
- margin-top: 0.1rem;
104
+ inline-size: 1.25rem;
105
+ block-size: 1.25rem;
106
+ margin-block-start: 0.1rem;
53
107
  color: var(--_accent);
54
108
  }
55
109
 
@@ -57,7 +111,7 @@
57
111
  display: flex;
58
112
  flex-direction: column;
59
113
  gap: var(--hl-space-1);
60
- min-width: 0;
114
+ min-inline-size: 0;
61
115
  }
62
116
 
63
117
  .hl-alert-title {
@@ -69,4 +123,11 @@
69
123
  .hl-alert p {
70
124
  margin: 0;
71
125
  }
126
+
127
+ /* Fills are flattened in forced colors, so the outline carries the shape. */
128
+ @media (forced-colors: active) {
129
+ .hl-alert {
130
+ border-color: CanvasText;
131
+ }
132
+ }
72
133
  }
package/dist/avatar.css CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Avatar: `<span class="hl-avatar">` containing an `<img>` or fallback
3
- * initials/icon. Stack with `<div class="hl-avatar-group">`.
3
+ * initials/icon. Stack with `<div class="hl-avatar-group">`. Pure CSS; there
4
+ * is no enhancer.
4
5
  * data-hl-size: xs | sm | md (default) | lg | xl
5
6
  * data-hl-shape: square
6
7
  */
@@ -10,25 +11,19 @@
10
11
 
11
12
  position: relative;
12
13
  display: inline-grid;
13
- align-items: center;
14
- justify-items: center;
15
14
  place-items: center;
16
15
  flex: none;
17
- width: 2.5rem;
18
- width: var(--_size);
19
- height: 2.5rem;
20
- height: var(--_size);
16
+ inline-size: var(--_size);
17
+ block-size: var(--_size);
21
18
  border-radius: var(--hl-radius-full);
22
19
  overflow: hidden;
23
20
  background: var(--hl-surface-3);
24
21
  color: var(--hl-fg-muted);
25
- font-size: calc(2.5rem * 0.4);
26
22
  font-size: calc(var(--_size) * 0.4);
27
23
  font-weight: var(--hl-font-medium);
28
24
  line-height: 1;
29
25
  text-transform: uppercase;
30
26
  -webkit-user-select: none;
31
- -moz-user-select: none;
32
27
  user-select: none;
33
28
  }
34
29
 
@@ -37,10 +32,9 @@
37
32
  }
38
33
 
39
34
  .hl-avatar > img {
40
- width: 100%;
41
- height: 100%;
42
- -o-object-fit: cover;
43
- object-fit: cover;
35
+ inline-size: 100%;
36
+ block-size: 100%;
37
+ object-fit: cover;
44
38
  }
45
39
 
46
40
  .hl-avatar[data-hl-size='xs'] {
@@ -69,6 +63,6 @@
69
63
  }
70
64
 
71
65
  .hl-avatar-group > .hl-avatar:not(:first-child) {
72
- margin-left: -0.6rem;
66
+ margin-inline-start: -0.6rem;
73
67
  }
74
68
  }
package/dist/badge.css CHANGED
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Badge: `<span class="hl-badge" data-hl-intent="…" data-hl-variant="…">`.
2
+ * Badge: `<span class="hl-badge" data-hl-intent="..." data-hl-variant="...">`.
3
+ * Pure CSS; there is no enhancer.
3
4
  * data-hl-intent: neutral (default) | primary | danger | success | warning | info
4
5
  * data-hl-variant: soft (default) | solid | outline
5
6
  * data-hl-size: sm | md (default)
@@ -81,4 +82,11 @@
81
82
  padding: 0 var(--hl-space-1-5);
82
83
  font-size: 0.6875rem;
83
84
  }
85
+
86
+ /* Soft and solid fills disappear in forced colors; keep the pill outline. */
87
+ @media (forced-colors: active) {
88
+ .hl-badge {
89
+ border-color: CanvasText;
90
+ }
91
+ }
84
92
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Breadcrumb: `<nav data-hl-breadcrumb aria-label="Breadcrumb">` wrapping an
3
+ * `<ol>` of links; the current page carries `aria-current="page"`. Pure CSS;
4
+ * there is no enhancer. Order follows the writing direction, so the trail
5
+ * reads right to left under RTL.
6
+ */
1
7
  @layer components {
2
8
  nav[data-hl-breadcrumb] ol {
3
9
  display: flex;
@@ -22,19 +28,17 @@
22
28
 
23
29
  nav[data-hl-breadcrumb] a {
24
30
  color: var(--hl-primary);
25
- -webkit-text-decoration: none;
26
31
  text-decoration: none;
27
32
  border-radius: var(--hl-radius-sm);
28
33
  }
29
34
 
30
35
  nav[data-hl-breadcrumb] a:hover {
31
- -webkit-text-decoration: underline;
32
36
  text-decoration: underline;
33
37
  }
34
38
 
35
39
  nav[data-hl-breadcrumb] a:focus-visible {
36
40
  outline: var(--hl-focus-ring);
37
- outline-offset: 2px;
41
+ outline-offset: var(--hl-focus-offset);
38
42
  }
39
43
 
40
44
  nav[data-hl-breadcrumb] [aria-current='page'] {
package/dist/button.css CHANGED
@@ -1,15 +1,17 @@
1
1
  /**
2
- * Button: `<button class="hl-button">` (works on `<a>`/`<input>` too).
2
+ * Button: `<button class="hl-button">` (works on `<a>`/`<input>` too). Pure
3
+ * CSS; there is no enhancer.
3
4
  *
4
5
  * Color is driven by a small set of local custom properties so the
5
- * intent × variant matrix stays DRY: `data-hl-intent` swaps the accent set,
6
+ * intent by variant matrix stays DRY: `data-hl-intent` swaps the accent set,
6
7
  * `data-hl-variant` decides how those values are applied.
7
8
  *
8
9
  * data-hl-variant: solid (default) | soft | outline | ghost | link
9
10
  * data-hl-intent: neutral (default) | primary | danger | success | warning | info
10
11
  * data-hl-size: sm | md (default) | lg
11
- * data-hl-block: stretch to container width
12
+ * data-hl-block: stretch to the container's inline size
12
13
  * data-hl-icon: square, icon-only
14
+ * data-hl-loading: shows a spinner and blocks interaction
13
15
  */
14
16
  @layer components {
15
17
  .hl-button {
@@ -29,9 +31,8 @@
29
31
  align-items: center;
30
32
  justify-content: center;
31
33
  gap: var(--_gap);
32
- height: var(--_height);
33
- padding-left: var(--_pad-x);
34
- padding-right: var(--_pad-x);
34
+ block-size: var(--_height);
35
+ padding-inline: var(--_pad-x);
35
36
  border: var(--hl-border-width) solid transparent;
36
37
  border-radius: var(--hl-radius-md);
37
38
  font-family: inherit;
@@ -39,16 +40,17 @@
39
40
  font-weight: var(--hl-font-medium);
40
41
  line-height: 1;
41
42
  white-space: nowrap;
42
- -webkit-text-decoration: none;
43
43
  text-decoration: none;
44
44
  cursor: pointer;
45
45
  -webkit-user-select: none;
46
- -moz-user-select: none;
47
46
  user-select: none;
48
47
  background: var(--_solid-bg);
49
48
  color: var(--_solid-fg);
50
49
  transition:
51
- background-color var(--hl-duration-fast) var(--hl-ease-standard), border-color var(--hl-duration-fast) var(--hl-ease-standard), color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
50
+ background-color var(--hl-duration-fast) var(--hl-ease-standard),
51
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
52
+ color var(--hl-duration-fast) var(--hl-ease-standard),
53
+ box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
52
54
  }
53
55
 
54
56
  .hl-button:hover {
@@ -61,14 +63,14 @@
61
63
 
62
64
  .hl-button:focus-visible {
63
65
  outline: var(--hl-focus-ring);
64
- outline-offset: 2px;
66
+ outline-offset: var(--hl-focus-offset);
65
67
  }
66
68
 
67
69
  .hl-button:disabled,
68
70
  .hl-button[aria-disabled='true'],
69
71
  .hl-button[data-hl-loading] {
70
72
  cursor: not-allowed;
71
- opacity: 0.55;
73
+ opacity: var(--hl-disabled-opacity);
72
74
  }
73
75
 
74
76
  .hl-button[data-hl-loading] {
@@ -155,12 +157,11 @@
155
157
  }
156
158
 
157
159
  .hl-button[data-hl-variant='link'] {
158
- height: auto;
160
+ block-size: auto;
159
161
  padding: 0;
160
162
  background: transparent;
161
163
  color: var(--_accent);
162
164
  border-color: transparent;
163
- -webkit-text-decoration: underline;
164
165
  text-decoration: underline;
165
166
  text-underline-offset: 0.2em;
166
167
  }
@@ -189,34 +190,34 @@
189
190
 
190
191
  .hl-button[data-hl-block] {
191
192
  display: flex;
192
- width: 100%;
193
+ inline-size: 100%;
193
194
  }
194
195
 
195
196
  .hl-button[data-hl-icon] {
196
- width: var(--_height);
197
- padding-left: 0;
198
- padding-right: 0;
197
+ inline-size: var(--_height);
198
+ padding-inline: 0;
199
199
  }
200
200
 
201
201
  .hl-button > svg {
202
- width: 1.1em;
203
- height: 1.1em;
202
+ inline-size: 1.1em;
203
+ block-size: 1.1em;
204
204
  flex: none;
205
205
  }
206
206
 
207
207
  .hl-button[data-hl-loading]::before {
208
208
  content: '';
209
- width: 1em;
210
- height: 1em;
209
+ inline-size: 1em;
210
+ block-size: 1em;
211
211
  border: 2px solid currentcolor;
212
- border-top-color: transparent;
212
+ border-block-start-color: transparent;
213
213
  border-radius: var(--hl-radius-full);
214
214
  animation: hl-button-spin 0.6s linear infinite;
215
215
  }
216
216
 
217
+ /* A static arc still reads as "busy" without continuous motion. */
217
218
  @media (prefers-reduced-motion: reduce) {
218
219
  .hl-button[data-hl-loading]::before {
219
- animation-duration: 1.4s;
220
+ animation: none;
220
221
  }
221
222
  }
222
223
 
@@ -235,21 +236,40 @@
235
236
  }
236
237
 
237
238
  .hl-button-group > .hl-button:not(:first-child) {
238
- margin-left: calc(var(--hl-border-width) * -1);
239
+ margin-inline-start: calc(var(--hl-border-width) * -1);
239
240
  }
240
241
 
241
242
  .hl-button-group > .hl-button:first-child {
242
- border-top-left-radius: var(--hl-radius-md);
243
- border-bottom-left-radius: var(--hl-radius-md);
243
+ border-start-start-radius: var(--hl-radius-md);
244
+ border-end-start-radius: var(--hl-radius-md);
244
245
  }
245
246
 
246
247
  .hl-button-group > .hl-button:last-child {
247
- border-top-right-radius: var(--hl-radius-md);
248
- border-bottom-right-radius: var(--hl-radius-md);
248
+ border-start-end-radius: var(--hl-radius-md);
249
+ border-end-end-radius: var(--hl-radius-md);
249
250
  }
250
251
 
251
252
  .hl-button-group > .hl-button:hover,
252
253
  .hl-button-group > .hl-button:focus-visible {
253
254
  z-index: 1;
254
255
  }
256
+
257
+ /* Forced colors flatten every fill to Canvas, so the border alone tells a
258
+ button apart from text; the link variant keeps reading as a link. */
259
+ @media (forced-colors: active) {
260
+ .hl-button {
261
+ border-color: ButtonBorder;
262
+ }
263
+
264
+ .hl-button[data-hl-variant='link'] {
265
+ border-color: transparent;
266
+ color: LinkText;
267
+ }
268
+
269
+ .hl-button:disabled,
270
+ .hl-button[aria-disabled='true'] {
271
+ color: GrayText;
272
+ border-color: GrayText;
273
+ }
274
+ }
255
275
  }
package/dist/card.css CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Card: `<div class="hl-card">` with optional `.hl-card-header`,
3
3
  * `.hl-card-body`, `.hl-card-footer`, `.hl-card-title`, `.hl-card-description`.
4
+ * Pure CSS; there is no enhancer.
4
5
  * data-hl-interactive: hover/active elevation for clickable cards
5
6
  */
6
7
  @layer components {
@@ -19,7 +20,7 @@
19
20
  flex-direction: column;
20
21
  gap: var(--hl-space-1);
21
22
  padding: var(--hl-space-4) var(--hl-space-5);
22
- border-bottom: var(--hl-border-width) solid var(--hl-border);
23
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
23
24
  }
24
25
 
25
26
  .hl-card-body {
@@ -32,7 +33,7 @@
32
33
  align-items: center;
33
34
  gap: var(--hl-space-2);
34
35
  padding: var(--hl-space-4) var(--hl-space-5);
35
- border-top: var(--hl-border-width) solid var(--hl-border);
36
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
36
37
  background: var(--hl-surface-2);
37
38
  }
38
39
 
@@ -52,7 +53,9 @@
52
53
  .hl-card[data-hl-interactive] {
53
54
  cursor: pointer;
54
55
  transition:
55
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-base) var(--hl-ease-standard), transform var(--hl-duration-base) var(--hl-ease-standard);
56
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
57
+ box-shadow var(--hl-duration-base) var(--hl-ease-standard),
58
+ translate var(--hl-duration-base) var(--hl-ease-standard);
56
59
  }
57
60
 
58
61
  .hl-card[data-hl-interactive]:hover {
@@ -62,10 +65,10 @@
62
65
 
63
66
  .hl-card[data-hl-interactive]:focus-within {
64
67
  outline: var(--hl-focus-ring);
65
- outline-offset: 2px;
68
+ outline-offset: var(--hl-focus-offset);
66
69
  }
67
70
 
68
71
  .hl-card[data-hl-interactive]:active {
69
- transform: translateY(1px);
72
+ translate: 0 1px;
70
73
  }
71
74
  }