actual-css 0.19.4 → 0.20.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.
- package/CHANGELOG.md +67 -0
- package/README.md +6 -6
- package/components.json +6 -3
- package/dist/actual.full.css +249 -50
- package/dist/actual.full.js +2 -2
- package/dist/actual.full.min.css +1 -1
- package/dist/types/menu.d.ts +2 -5
- package/docs/pages/components/accordion.md +11 -6
- package/docs/pages/components/alert.md +64 -62
- package/docs/pages/components/avatar.md +12 -12
- package/docs/pages/components/badge.md +15 -15
- package/docs/pages/components/breadcrumb.md +10 -8
- package/docs/pages/components/button.md +56 -7
- package/docs/pages/components/card.md +21 -21
- package/docs/pages/components/dialog.md +97 -69
- package/docs/pages/components/drawer.md +33 -33
- package/docs/pages/components/indicator.md +12 -12
- package/docs/pages/components/navbar.md +41 -9
- package/docs/pages/components/pagination.md +7 -7
- package/docs/pages/components/progress.md +18 -13
- package/docs/pages/components/rating.md +19 -19
- package/docs/pages/components/reveal.md +2 -0
- package/docs/pages/components/segmented.md +35 -31
- package/docs/pages/components/skeleton.md +10 -8
- package/docs/pages/components/spinner.md +21 -15
- package/docs/pages/components/table.md +26 -28
- package/docs/pages/enhancements/flyout.md +94 -43
- package/docs/pages/enhancements/in-view.md +3 -1
- package/docs/pages/enhancements/scrollspy.md +51 -18
- package/docs/pages/enhancements/tabs.md +43 -37
- package/docs/pages/enhancements/tooltip.md +4 -2
- package/docs/pages/forms/ajax.md +66 -0
- package/docs/pages/forms/choice-cards.md +8 -8
- package/docs/pages/forms/color-swatches.md +12 -12
- package/docs/pages/forms/form-actions.md +23 -0
- package/docs/pages/forms/joined-controls.md +8 -8
- package/docs/pages/forms/labels.md +11 -11
- package/docs/pages/forms/overview.md +35 -29
- package/docs/pages/forms/states-and-sizes.md +9 -9
- package/docs/pages/forms/switch.md +35 -2
- package/docs/pages/forms/validation.md +16 -16
- package/docs/pages/foundations/theming.md +32 -2
- package/docs/pages/foundations/tokens.md +18 -16
- package/docs/pages/guides/coding-agents.md +18 -0
- package/docs/pages/guides/introduction.md +1 -1
- package/llms.txt +3 -3
- package/package.json +5 -5
- package/reserved-classes.json +1 -0
- package/skills/actual-css/SKILL.md +7 -0
- package/src/cli/actual-css.js +3 -3
- package/src/css/components/badge.css +10 -6
- package/src/css/components/button.css +20 -7
- package/src/css/components/join.css +14 -4
- package/src/css/components/navbar.css +83 -1
- package/src/css/components/pagination.css +3 -1
- package/src/css/components/segmented.css +27 -7
- package/src/css/core/theme.css +11 -9
- package/src/css/core/tokens.css +7 -1
- package/src/css/core/variants.css +2 -0
- package/src/css/effects/reveal.css +15 -6
- package/src/css/forms/control.css +11 -1
- package/src/css/forms/form.css +14 -4
- package/src/css/forms/switch.css +32 -3
- package/src/js/ajax.js +18 -1
- package/src/js/context-menu.js +1 -3
- package/src/js/flyout.js +14 -5
- package/src/js/in-view.js +41 -30
- package/src/js/menu.js +9 -21
- package/src/js/surface.js +38 -0
- package/src/tooling/design-tokens.js +1 -0
- package/src/tooling/theme-contrast.js +24 -9
- package/tokens.json +1 -0
- package/docs/design-notes/accessibility-decisions.md +0 -63
- package/docs/design-notes/app-ui.md +0 -67
- package/docs/design-notes/architecture.md +0 -70
- package/docs/design-notes/browser-support.md +0 -239
- package/docs/design-notes/cascade-layer.md +0 -74
- package/docs/design-notes/column-layout.md +0 -260
- package/docs/design-notes/css-anchor.md +0 -87
- package/docs/design-notes/enhancement-contract.md +0 -193
- package/docs/design-notes/forced-colors.md +0 -123
- package/docs/design-notes/grid.md +0 -785
- package/docs/design-notes/motion-cost.md +0 -62
- package/docs/design-notes/naming.md +0 -71
- package/docs/design-notes/platform-alignment.md +0 -602
- package/docs/design-notes/popover-manual-poc.md +0 -328
- package/docs/design-notes/references.md +0 -336
- package/docs/design-notes/rich-text.md +0 -61
- package/docs/design-notes/spacing-units.md +0 -286
- package/docs/design-notes/steps.md +0 -776
- package/docs/design-notes/surface-reparenting.md +0 -130
- package/docs/design-notes/tokens.md +0 -166
- package/docs/design-notes/tooltip-coordinate-space.md +0 -130
- package/docs/design-notes/widget-primitives.md +0 -144
- package/docs/navigation.json +0 -176
package/dist/types/menu.d.ts
CHANGED
|
@@ -3,10 +3,7 @@ export declare function hasMenuItems(menu: any): boolean;
|
|
|
3
3
|
export declare function hasMenuItem(menu: any, target: any): boolean;
|
|
4
4
|
export declare function focusFirstMenuItem(menu: any): void;
|
|
5
5
|
export declare function focusLastMenuItem(menu: any): void;
|
|
6
|
-
export declare function onMenuKeydown(e: any, {
|
|
7
|
-
close: any;
|
|
6
|
+
export declare function onMenuKeydown(e: any, { navigate }?: {
|
|
8
7
|
navigate?: boolean | undefined;
|
|
9
8
|
}): void;
|
|
10
|
-
export declare function connectMenu(menu: any
|
|
11
|
-
close: any;
|
|
12
|
-
}): () => void;
|
|
9
|
+
export declare function connectMenu(menu: any): () => void;
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
> Collapsible regions built on native details and summary, with optional exclusive groups via the name attribute.
|
|
4
4
|
|
|
5
|
-
- Use native `<details>` and `<summary>` for collapsible content.
|
|
6
|
-
- Use the `name` attribute for exclusive accordions.
|
|
7
|
-
- Supports any valid body element (`div`, `p`, `ul`, ...).
|
|
8
|
-
- Three container treatments: the default common shell, `.flush` (bare separators, for embedding inside an existing surface), and `.separated` (independent items).
|
|
9
|
-
- The end marker is a chevron that turns when open; its glyph, turn, color, and size are hooks.
|
|
10
|
-
|
|
11
5
|
```html demo
|
|
12
6
|
<div class="accordion">
|
|
13
7
|
<details open>
|
|
@@ -35,6 +29,17 @@
|
|
|
35
29
|
</div>
|
|
36
30
|
```
|
|
37
31
|
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
- Use an accordion for independent sections that people can read on demand,
|
|
35
|
+
such as answers to common questions. Keep instructions that everyone needs
|
|
36
|
+
visible, and use [tabs](../enhancements/tabs.md) for switching between
|
|
37
|
+
distinct views in the same space.
|
|
38
|
+
- Write each `<summary>` so its topic is clear while the panel is closed.
|
|
39
|
+
Keep links and buttons in the panel body.
|
|
40
|
+
- The browser owns disclosure state through `open`. Use a shared `name` when
|
|
41
|
+
opening one item should close the others.
|
|
42
|
+
|
|
38
43
|
## Variants
|
|
39
44
|
|
|
40
45
|
The default builds one raised shell around the whole group. `.flush` and `.separated` only change that chrome — they are integration modes between the component and its container, not decorative skins.
|
|
@@ -2,25 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
> Inline status messages for confirmations, warnings, and errors, with intents, icons, and action lists.
|
|
4
4
|
|
|
5
|
+
```html demo
|
|
6
|
+
<div class="stack">
|
|
7
|
+
<div class="alert surface">
|
|
8
|
+
<i class="ti ti-info-circle alert-icon" aria-hidden="true"></i>
|
|
9
|
+
<div><strong>New message.</strong> 12 unread. <a href="#">Open inbox</a>.</div>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<div class="alert success">
|
|
13
|
+
<i class="ti ti-circle-check alert-icon" aria-hidden="true"></i>
|
|
14
|
+
<div>Your changes have been saved. <a href="#">View activity</a>.</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div class="alert warning">
|
|
18
|
+
<svg class="alert-icon" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>
|
|
19
|
+
<div>Please review the <a href="#">failed checks</a> before continuing.</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="alert">
|
|
23
|
+
<svg class="alert-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94"/></svg>
|
|
24
|
+
<div>This is a default alert message.</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="alert danger">
|
|
28
|
+
<strong>Couldn't save the draft.</strong>
|
|
29
|
+
<div>The connection dropped. Your changes are kept on this device.</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="alert danger">
|
|
33
|
+
Your session expired. <a href="#">Sign in again</a>.
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
5
40
|
**Related terms:** banner, callout, notice, inline notification, install prompt, trailing action.
|
|
6
41
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Because alerts are soft by default, adding `.soft` to an intent (`.alert.soft.primary`,
|
|
21
|
-
`.alert.soft.danger`, …) is a no-op: it already resolves to a soft version of that
|
|
22
|
-
intent. Reach for `.solid` (stronger) or `.outline` (quieter) when the emphasis
|
|
23
|
-
itself needs to change, not `.soft`.
|
|
42
|
+
- Place an alert near the content it concerns and keep it visible while the
|
|
43
|
+
information is relevant or the user can act on it.
|
|
44
|
+
- Use a [status bar](../enhancements/status-bar.md) for brief confirmations
|
|
45
|
+
such as “Copied,” a [dialog](dialog.md) when a decision is required to
|
|
46
|
+
continue, and [field validation](../forms/validation.md) for errors the user
|
|
47
|
+
can fix in a specific field.
|
|
48
|
+
- Reserve `role="alert"` for urgent, dynamically updated text. Use
|
|
49
|
+
`role="status"` for polite announcements. Notices that are present as part
|
|
50
|
+
of the page content can use ordinary markup.
|
|
51
|
+
- Use `.surface` for neutral chrome with intent in the ink, or `.solid` and
|
|
52
|
+
`.outline` to change the emphasis. Use `.compact` or `.spacious` to adjust
|
|
53
|
+
block padding while keeping the inline padding.
|
|
24
54
|
|
|
25
55
|
## Class reference
|
|
26
56
|
|
|
@@ -54,49 +84,17 @@ itself needs to change, not `.soft`.
|
|
|
54
84
|
└── content any HTML
|
|
55
85
|
```
|
|
56
86
|
|
|
57
|
-
## Basic usage
|
|
58
|
-
|
|
59
|
-
`.surface` comes first on purpose: it keeps the theme's own chrome and puts the
|
|
60
|
-
intent in the ink alone, which is what most informational messages want. Add an
|
|
61
|
-
intent treatment when the color itself carries the meaning.
|
|
62
|
-
|
|
63
|
-
```html demo
|
|
64
|
-
<div class="stack">
|
|
65
|
-
<div class="alert surface">
|
|
66
|
-
<i class="ti ti-info-circle alert-icon" aria-hidden="true"></i>
|
|
67
|
-
<div><strong>New message.</strong> 12 unread. <a href="#">Open inbox</a>.</div>
|
|
68
|
-
</div>
|
|
69
|
-
|
|
70
|
-
<div class="alert success">
|
|
71
|
-
<i class="ti ti-circle-check alert-icon" aria-hidden="true"></i>
|
|
72
|
-
<div>Your changes have been saved. <a href="#">View activity</a>.</div>
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
<div class="alert warning" role="alert">
|
|
76
|
-
<svg class="alert-icon" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>
|
|
77
|
-
<div>Please review the <a href="#">failed checks</a> before continuing.</div>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<div class="alert">
|
|
81
|
-
<svg class="alert-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94"/></svg>
|
|
82
|
-
<div>This is a default alert message.</div>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<div class="alert danger" role="alert">
|
|
86
|
-
<strong>Couldn't save the draft.</strong>
|
|
87
|
-
<div>The connection dropped. Your changes are kept on this device.</div>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
<div class="alert danger" role="alert">
|
|
91
|
-
Your session expired. <a href="#">Sign in again</a>.
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
87
|
## Content and actions
|
|
97
88
|
|
|
89
|
+
- Lead with the outcome or problem. Add a title when it helps scanning and use
|
|
90
|
+
the body for what happened or what the user can do next.
|
|
91
|
+
- Name the next action directly, such as “Update billing.” Group multiple
|
|
92
|
+
actions in a `<menu class="cluster">`.
|
|
93
|
+
- Place a title and description as siblings to use the alert's own spacing.
|
|
94
|
+
Use `.prose` for several paragraphs or `.stack` for a group with its own gap.
|
|
95
|
+
|
|
98
96
|
```html demo
|
|
99
|
-
<div class="alert danger"
|
|
97
|
+
<div class="alert danger">
|
|
100
98
|
<i class="ti ti-alert-triangle alert-icon" aria-hidden="true"></i>
|
|
101
99
|
|
|
102
100
|
<div class="stack">
|
|
@@ -154,15 +152,15 @@ the whole block.
|
|
|
154
152
|
|
|
155
153
|
```html demo
|
|
156
154
|
<div class="stack">
|
|
157
|
-
<div class="alert surface"
|
|
155
|
+
<div class="alert surface">
|
|
158
156
|
I'm a surface alert — theme chrome, intent in the ink
|
|
159
157
|
</div>
|
|
160
158
|
|
|
161
|
-
<div class="alert danger outline"
|
|
159
|
+
<div class="alert danger outline">
|
|
162
160
|
I'm an outline error <a href="#">with a link</a>
|
|
163
161
|
</div>
|
|
164
162
|
|
|
165
|
-
<div class="alert danger solid"
|
|
163
|
+
<div class="alert danger solid">
|
|
166
164
|
I'm a solid error <a href="#">with a link</a>
|
|
167
165
|
</div>
|
|
168
166
|
</div>
|
|
@@ -170,7 +168,11 @@ the whole block.
|
|
|
170
168
|
|
|
171
169
|
## Dismiss
|
|
172
170
|
|
|
173
|
-
Add a `.close` button to let a user remove an inline alert.
|
|
171
|
+
Add a [`.close`](close.md) button to let a user remove an inline alert. Give
|
|
172
|
+
the alert an `id` and point the button at it with `commandfor` and
|
|
173
|
+
`command="--dismiss"`. The runtime sets `hidden` and moves focus to a nearby
|
|
174
|
+
control when focus would otherwise be lost. See
|
|
175
|
+
[Dismiss command](../guides/progressive-enhancement.md#dismiss-command).
|
|
174
176
|
|
|
175
177
|
```html demo
|
|
176
178
|
<div class="alert warning" id="warning-alert">
|
|
@@ -221,7 +223,7 @@ the border.
|
|
|
221
223
|
<p>A neutral panel with a thick accent flag on the leading edge.</p>
|
|
222
224
|
</div>
|
|
223
225
|
|
|
224
|
-
<div class="alert warning callout"
|
|
226
|
+
<div class="alert warning callout">
|
|
225
227
|
<strong>Heads up</strong>
|
|
226
228
|
<p>The intent tints the panel and the flag together.</p>
|
|
227
229
|
</div>
|
|
@@ -11,18 +11,6 @@
|
|
|
11
11
|
- Sizes can be adjusted with CSS variables and optional `.sm` or `.lg`.
|
|
12
12
|
- Background is an exposed css variable (and can use `data-tone`).
|
|
13
13
|
|
|
14
|
-
## Class reference
|
|
15
|
-
|
|
16
|
-
| Class | Kind | Description |
|
|
17
|
-
| --------------- | ----------- | -------------------------------------- |
|
|
18
|
-
| `.avatar` | Component | Initials or image in a circular box. |
|
|
19
|
-
| `.avatar-stack` | Composition | Overlapping avatar group. |
|
|
20
|
-
| `.badge:empty` | Composition | Status dot, at the bottom-end corner. |
|
|
21
|
-
| `.sm` / `.lg` | Size | Optical size, on an avatar or a stack. |
|
|
22
|
-
|
|
23
|
-
`.avatar` works on `div`, `a` and `button`. The status dot is an empty
|
|
24
|
-
`.badge` inside an `.avatar`, and needs an `aria-label` of its own.
|
|
25
|
-
|
|
26
14
|
## Basic usage
|
|
27
15
|
|
|
28
16
|
```html demo
|
|
@@ -84,6 +72,18 @@ accessible name, as in `aria-label="JD, Jane Doe: profile menu"`, so a speech
|
|
|
84
72
|
user can say what they see (WCAG 2.5.3, *Label in Name*). A name without the
|
|
85
73
|
initials fails that check even when the initials are `aria-hidden`.
|
|
86
74
|
|
|
75
|
+
## Class reference
|
|
76
|
+
|
|
77
|
+
| Class | Kind | Description |
|
|
78
|
+
| --------------- | ----------- | -------------------------------------- |
|
|
79
|
+
| `.avatar` | Component | Initials or image in a circular box. |
|
|
80
|
+
| `.avatar-stack` | Composition | Overlapping avatar group. |
|
|
81
|
+
| `.badge:empty` | Composition | Status dot, at the bottom-end corner. |
|
|
82
|
+
| `.sm` / `.lg` | Size | Optical size, on an avatar or a stack. |
|
|
83
|
+
|
|
84
|
+
`.avatar` works on `div`, `a` and `button`. The status dot is an empty
|
|
85
|
+
`.badge` inside an `.avatar`, and needs an `aria-label` of its own.
|
|
86
|
+
|
|
87
87
|
## Avatar stack
|
|
88
88
|
|
|
89
89
|
Set `.sm` or `.lg` on `.avatar-stack` to size the group; its avatars inherit
|
|
@@ -25,6 +25,21 @@ optional `.inline-size-full` utility — when a full-width badge is intentional.
|
|
|
25
25
|
|
|
26
26
|
**Related terms:** chip, tag, pill, removable tag, user chip, mention, assignee.
|
|
27
27
|
|
|
28
|
+
## Basic usage
|
|
29
|
+
|
|
30
|
+
```html demo
|
|
31
|
+
<span class="badge">Default</span>
|
|
32
|
+
<span class="badge secondary">Secondary</span>
|
|
33
|
+
<span class="badge success">Success</span>
|
|
34
|
+
<span class="badge warning">Warning</span>
|
|
35
|
+
<span class="badge danger">Danger</span>
|
|
36
|
+
<span class="badge success outline">Outline success</span>
|
|
37
|
+
<span class="badge warning soft">Soft warning</span>
|
|
38
|
+
<span class="badge primary solid">Solid primary</span>
|
|
39
|
+
<span class="badge success solid">Solid success</span>
|
|
40
|
+
<span class="badge danger solid">Solid danger</span>
|
|
41
|
+
```
|
|
42
|
+
|
|
28
43
|
## Class reference
|
|
29
44
|
|
|
30
45
|
| Class | Kind | Description |
|
|
@@ -41,21 +56,6 @@ The shared intents are `.primary`, `.secondary`, `.success`, `.warning` and
|
|
|
41
56
|
`.danger`. The variants set emphasis: `.solid` is filled, `.outline` bordered,
|
|
42
57
|
`.surface` untinted.
|
|
43
58
|
|
|
44
|
-
## Basic usage
|
|
45
|
-
|
|
46
|
-
```html demo
|
|
47
|
-
<span class="badge">Default</span>
|
|
48
|
-
<span class="badge secondary">Secondary</span>
|
|
49
|
-
<span class="badge success">Success</span>
|
|
50
|
-
<span class="badge warning">Warning</span>
|
|
51
|
-
<span class="badge danger">Danger</span>
|
|
52
|
-
<span class="badge success outline">Outline success</span>
|
|
53
|
-
<span class="badge warning soft">Soft warning</span>
|
|
54
|
-
<span class="badge primary solid">Solid primary</span>
|
|
55
|
-
<span class="badge success solid">Solid success</span>
|
|
56
|
-
<span class="badge danger solid">Solid danger</span>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
59
|
## In a title
|
|
60
60
|
|
|
61
61
|
```html demo
|
|
@@ -2,14 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
> Trail of links showing the current page's location in a hierarchy.
|
|
4
4
|
|
|
5
|
-
- Use a semantic `<nav>` landmark.
|
|
6
|
-
- Put `.breadcrumb` on the ordered list.
|
|
7
|
-
- Use `aria-current="page"` for the current page, on its link or on its `<li>`,
|
|
8
|
-
and keep it last.
|
|
9
|
-
- Separators are generated with CSS (`> li + li::before`).
|
|
10
|
-
- Put each ancestor label in an `<a>` or a `<span>`: that box carries the
|
|
11
|
-
ellipsis. The current page may be bare text in an `<li aria-current="page">`.
|
|
12
|
-
|
|
13
5
|
```html demo
|
|
14
6
|
<nav aria-label="Breadcrumb">
|
|
15
7
|
<ol class="breadcrumb">
|
|
@@ -21,6 +13,16 @@
|
|
|
21
13
|
</nav>
|
|
22
14
|
```
|
|
23
15
|
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
- Show where the current page sits in the site hierarchy so people can go
|
|
19
|
+
back to a parent section. Use [steps](steps.md) for a process with stages.
|
|
20
|
+
- Give the `<nav>` an accessible name and put `.breadcrumb` on the ordered
|
|
21
|
+
list. Mark the current page last with `aria-current="page"` on its link or
|
|
22
|
+
its `<li>`.
|
|
23
|
+
- Put each ancestor label in an `<a>` or a `<span>` so it can truncate. The
|
|
24
|
+
current page may be bare text in an `<li aria-current="page">`.
|
|
25
|
+
|
|
24
26
|
## Narrow space
|
|
25
27
|
|
|
26
28
|
A trail stays on one line and never scrolls. When it does not fit, labels
|
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
Actions and navigation with shared intents, variants, sizes, and loading, pressed, and disabled states.
|
|
4
4
|
|
|
5
|
+
```html demo
|
|
6
|
+
<div class="cluster">
|
|
7
|
+
<button class="btn primary" type="button">Save changes</button>
|
|
8
|
+
<button class="btn outline" type="button">Cancel</button>
|
|
9
|
+
</div>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
- Give one action per decision context the strongest treatment; two primary
|
|
15
|
+
buttons in the same group compete. Use quieter treatments for alternatives,
|
|
16
|
+
and reserve the `danger` intent for destructive actions.
|
|
17
|
+
- Name the action, with its object when it clarifies: “Save changes”,
|
|
18
|
+
“Delete project”. Common actions such as “Close”, “Cancel” or “Done” stand
|
|
19
|
+
alone. A label should still make sense read out of context.
|
|
20
|
+
- Keep a group to two or three actions; move the rest into an
|
|
21
|
+
[action list](../enhancements/flyout.md#action-list).
|
|
22
|
+
- Let a long or translated label wrap to a second line rather than truncating
|
|
23
|
+
it.
|
|
24
|
+
|
|
5
25
|
## Class reference
|
|
6
26
|
|
|
7
27
|
| Class | Kind | Description |
|
|
@@ -77,9 +97,9 @@ Actual CSS or import `actual.layer.css`.
|
|
|
77
97
|
|
|
78
98
|
Transparent treatments (`.outline`, `.ghost`, `.link`) take their text from the
|
|
79
99
|
surrounding foreground by default, including on a band your application paints.
|
|
80
|
-
A neutral outline draws its border with `--border
|
|
81
|
-
|
|
82
|
-
`--ui-border` when the border must follow the band. A local intent class still
|
|
100
|
+
A neutral outline draws its border with `--border`: its label identifies it, so
|
|
101
|
+
it needs no 3:1 control edge. Beside a field in a `.join`, it takes the field's
|
|
102
|
+
edge instead. Set `--ui-border` when the border must follow the band. A local intent class still
|
|
83
103
|
wins: `.danger.outline` uses the danger color in any context, and nothing tunes
|
|
84
104
|
that color for a surface you paint yourself. For intent ink on a dark band, use
|
|
85
105
|
a `data-theme` island, whose palette is tuned for its surface. Filled buttons
|
|
@@ -124,7 +144,9 @@ container. For a plain text link, use a bare `<a>` with no class.
|
|
|
124
144
|
|
|
125
145
|
```html demo
|
|
126
146
|
<div class="cluster">
|
|
127
|
-
<button class="btn" type="button"
|
|
147
|
+
<button class="btn primary" type="button">Create resource <i class="ti ti-plus" aria-hidden="true"></i></button>
|
|
148
|
+
<button class="btn outline" type="button">Download report <i class="ti ti-download" aria-hidden="true"></i></button>
|
|
149
|
+
<button class="btn ghost" type="button"><i class="ti ti-arrow-left" aria-hidden="true"></i> Back</button>
|
|
128
150
|
<button class="btn icon-only" type="button" aria-label="Add">
|
|
129
151
|
<i class="ti ti-plus" aria-hidden="true"></i>
|
|
130
152
|
</button>
|
|
@@ -134,8 +156,16 @@ container. For a plain text link, use a bare `<a>` with no class.
|
|
|
134
156
|
</div>
|
|
135
157
|
```
|
|
136
158
|
|
|
159
|
+
Put the icon after the label by default: the action reads first. A direction
|
|
160
|
+
that points backward, such as “Back”, keeps its arrow before the label. In a
|
|
161
|
+
group, give every button an icon or none, and draw them in one icon style.
|
|
162
|
+
For a button as wide as its form column, see
|
|
163
|
+
[a full-width submit](../forms/form-actions.md#full-width-submit).
|
|
164
|
+
|
|
137
165
|
Use `.btn.icon-only` for a square icon button sized to the control height.
|
|
138
|
-
Always name it with an `aria-label` since there is no visible text
|
|
166
|
+
Always name it with an `aria-label` since there is no visible text; a
|
|
167
|
+
[tooltip](../enhancements/tooltip.md) shows that name to sighted users. Prefer
|
|
168
|
+
a visible label when the icon is not familiar or the action is destructive.
|
|
139
169
|
|
|
140
170
|
### Button groups
|
|
141
171
|
|
|
@@ -159,6 +189,18 @@ meaningful state, such as a solid pressed [toggle](#toggle) among outlines.
|
|
|
159
189
|
For one choice among a few on a shared track, use a
|
|
160
190
|
[segmented control](segmented.md).
|
|
161
191
|
|
|
192
|
+
Two buttons that settle one decision can share their width: a `.switcher`
|
|
193
|
+
gives them equal columns and stacks them when the row runs out of room. Keep
|
|
194
|
+
intrinsic widths everywhere else, such as a toolbar or a row with a ghost
|
|
195
|
+
“Skip”.
|
|
196
|
+
|
|
197
|
+
```html demo
|
|
198
|
+
<div class="switcher" style="--switcher-threshold: 20rem">
|
|
199
|
+
<button class="btn outline" type="button">Keep location</button>
|
|
200
|
+
<button class="btn danger" type="button">Delete location</button>
|
|
201
|
+
</div>
|
|
202
|
+
```
|
|
203
|
+
|
|
162
204
|
## Sizes
|
|
163
205
|
|
|
164
206
|
Prefer `.sm` and `.lg` over setting sizes directly. They scale control geometry
|
|
@@ -209,8 +251,11 @@ prevent the click since `aria-disabled` does not stop navigation on its own.
|
|
|
209
251
|
|
|
210
252
|
### Loading
|
|
211
253
|
|
|
212
|
-
|
|
213
|
-
|
|
254
|
+
Show loading on the button when that action is what the user is waiting for.
|
|
255
|
+
Set `aria-busy="true"` and add a `.spinner` beside a label that names the
|
|
256
|
+
operation. Use the form's [request state](../forms/ajax.md#request-state) for
|
|
257
|
+
an Ajax submit, or manage the busy state and repeat activation in application
|
|
258
|
+
code.
|
|
214
259
|
|
|
215
260
|
```html demo
|
|
216
261
|
<div class="cluster">
|
|
@@ -303,6 +348,10 @@ on its components. Tap both rows on a phone to compare:
|
|
|
303
348
|
|
|
304
349
|
## CSS hooks
|
|
305
350
|
|
|
351
|
+
- `--btn-font-size` — label size, one type step below the field text and
|
|
352
|
+
selected by `.sm`/`.lg`. It inherits, so a container can set it for every
|
|
353
|
+
button inside. `.btn.link` takes the surrounding text size and `.icon-only`
|
|
354
|
+
the field text size instead.
|
|
306
355
|
- `--btn-radius` — corner radius.
|
|
307
356
|
- `--btn-gap` — space between an icon and the label text (default `0.375em`).
|
|
308
357
|
- `--btn-shadow` — resting elevation (unset by default). It inherits, so a
|
|
@@ -2,27 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Flexible content container with optional header, body, and footer regions.
|
|
4
4
|
|
|
5
|
-
## Class reference
|
|
6
|
-
|
|
7
|
-
| Class | Kind | Description |
|
|
8
|
-
| ---------- | --------- | ----------------------------------------------- |
|
|
9
|
-
| `.card` | Component | Neutral raised surface for grouped content. |
|
|
10
|
-
| `.raised` | Variant | Elevated surface with a soft shadow. |
|
|
11
|
-
| `.subtle` | Variant | Lower contrast against the page surface. |
|
|
12
|
-
| `.surface` | Variant | The page surface; intent in the text only. |
|
|
13
|
-
| `.compact` | Density | Tighter padding and compact descendant context. |
|
|
14
|
-
|
|
15
|
-
`.surface` is a shared variant: it paints the page surface instead of
|
|
16
|
-
`--surface-raised` and leaves the intent to the text. For a dark card on a
|
|
17
|
-
light page (or the reverse), put `data-theme="dark"` on the card.
|
|
18
|
-
|
|
19
|
-
Shared `.soft` with an intent class gives the card a tone: an opaque surface
|
|
20
|
-
tinted by the intent, with the soft ink. See [Tones](#tones).
|
|
21
|
-
|
|
22
|
-
On `.card.solid`, bare and `.prose` links follow the surrounding text color,
|
|
23
|
-
including hover and keyboard focus, instead of the theme's `--link` ink.
|
|
24
|
-
Nested cards and `data-theme` islands establish their own link context.
|
|
25
|
-
|
|
26
5
|
## Basic usage
|
|
27
6
|
|
|
28
7
|
Use semantic elements inside the card. A direct `<header>` or `<footer>` is the
|
|
@@ -59,6 +38,27 @@ to let that primitive control its layout and gap.
|
|
|
59
38
|
</div>
|
|
60
39
|
```
|
|
61
40
|
|
|
41
|
+
## Class reference
|
|
42
|
+
|
|
43
|
+
| Class | Kind | Description |
|
|
44
|
+
| ---------- | --------- | ----------------------------------------------- |
|
|
45
|
+
| `.card` | Component | Neutral raised surface for grouped content. |
|
|
46
|
+
| `.raised` | Variant | Elevated surface with a soft shadow. |
|
|
47
|
+
| `.subtle` | Variant | Lower contrast against the page surface. |
|
|
48
|
+
| `.surface` | Variant | The page surface; intent in the text only. |
|
|
49
|
+
| `.compact` | Density | Tighter padding and compact descendant context. |
|
|
50
|
+
|
|
51
|
+
`.surface` is a shared variant: it paints the page surface instead of
|
|
52
|
+
`--surface-raised` and leaves the intent to the text. For a dark card on a
|
|
53
|
+
light page (or the reverse), put `data-theme="dark"` on the card.
|
|
54
|
+
|
|
55
|
+
Shared `.soft` with an intent class gives the card a tone: an opaque surface
|
|
56
|
+
tinted by the intent, with the soft ink. See [Tones](#tones).
|
|
57
|
+
|
|
58
|
+
On `.card.solid`, bare and `.prose` links follow the surrounding text color,
|
|
59
|
+
including hover and keyboard focus, instead of the theme's `--link` ink.
|
|
60
|
+
Nested cards and `data-theme` islands establish their own link context.
|
|
61
|
+
|
|
62
62
|
## Slot rows
|
|
63
63
|
|
|
64
64
|
A direct `<header>` or `<footer>` is a wrapping split row by default: title and
|