@fusion.dev/helix-docs 0.104.0 → 0.105.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/content/accessibility.mdx +92 -71
- package/content/angular.mdx +26 -24
- package/content/browser-support.mdx +61 -58
- package/content/building-on-the-headless-tier.mdx +100 -74
- package/content/charting.mdx +98 -79
- package/content/coding-agents.mdx +87 -69
- package/content/color-modes.mdx +40 -37
- package/content/color.mdx +67 -54
- package/content/composition.mdx +85 -83
- package/content/elevation-and-material.mdx +32 -29
- package/content/events.mdx +77 -65
- package/content/forms.mdx +69 -58
- package/content/iconography.mdx +75 -71
- package/content/installation.mdx +77 -68
- package/content/intent-reference.mdx +59 -54
- package/content/introduction.mdx +25 -23
- package/content/localization.mdx +122 -82
- package/content/maps.mdx +222 -0
- package/content/metrics.mdx +294 -297
- package/content/motion.mdx +44 -36
- package/content/other-frameworks.mdx +33 -31
- package/content/overlays.mdx +72 -54
- package/content/overriding-a-component.mdx +85 -74
- package/content/react.mdx +72 -64
- package/content/recipes.mdx +64 -47
- package/content/routing.mdx +100 -93
- package/content/sandbox.mdx +39 -39
- package/content/server-rendering.mdx +95 -84
- package/content/shape-and-borders.mdx +44 -37
- package/content/size-and-density.mdx +51 -46
- package/content/space-and-size.mdx +41 -34
- package/content/state-and-control.mdx +63 -51
- package/content/surfaces-and-separation.mdx +55 -53
- package/content/svelte.mdx +20 -19
- package/content/theme-builder.mdx +42 -31
- package/content/theming.mdx +58 -51
- package/content/tiers.mdx +69 -61
- package/content/tokens.mdx +72 -53
- package/content/typography.mdx +47 -47
- package/content/using-helix-with-an-agent.mdx +147 -115
- package/content/using-the-elements.mdx +55 -50
- package/content/versioning.mdx +42 -35
- package/content/visual-axes.mdx +168 -146
- package/content/vue.mdx +24 -24
- package/content/without-a-bundler.mdx +40 -23
- package/dist/pages.generated.js +49 -43
- package/dist/sources.generated.js +3337 -2680
- package/package.json +3 -3
package/content/visual-axes.mdx
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: The attributes that set how a component looks, the values each one accepts, and what each value draws.
|
|
3
3
|
section: Theming
|
|
4
4
|
title: Visual axes
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Visual axes
|
|
8
8
|
|
|
9
|
-
A component's visual
|
|
10
|
-
|
|
9
|
+
A component's visual options come from a registry of axes. Each axis has a
|
|
10
|
+
fixed set of values. You cannot add a value of your own, and a component can
|
|
11
|
+
accept a subset of an axis's values.
|
|
11
12
|
|
|
12
13
|
| Axis | Values |
|
|
13
14
|
|---|---|
|
|
@@ -16,7 +17,7 @@ vocabularies. You cannot invent a value, and a component may take a subset.
|
|
|
16
17
|
| `nesting` | `heading`, `peer`, `subordinate` |
|
|
17
18
|
| `orientation` | `auto`, `horizontal`, `vertical` |
|
|
18
19
|
| `separation` | `elevated`, `filled`, `outlined`, `plain` |
|
|
19
|
-
| `shape` | `arc`, `circle`, `diamond`, `dots`, `pill`, `ring`, `rounded`, `square`, `text` |
|
|
20
|
+
| `shape` | `arc`, `circle`, `diamond`, `dots`, `pill`, `pin`, `ring`, `rounded`, `square`, `text` |
|
|
20
21
|
| `size` | `sm`, `md`, `lg`, `full` |
|
|
21
22
|
| `tone` | The status and intent words: `primary`, `accent`, `neutral`, `danger`, and so on |
|
|
22
23
|
| `width` | `auto`, `full` |
|
|
@@ -30,113 +31,123 @@ vocabularies. You cannot invent a value, and a component may take a subset.
|
|
|
30
31
|
<helix-megamenu material="glass">…</helix-megamenu>
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
## Why
|
|
34
|
+
## Why there is no `appearance` attribute
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ink a control claims (`ghost` against `solid` on a Button), which widget gets
|
|
38
|
-
rendered (`segmented` against `underlined` on Tabs), and in one case a plain
|
|
39
|
-
misfiled tone.
|
|
36
|
+
Helix once used one attribute, `appearance`, for at least four different
|
|
37
|
+
settings across both tiers:
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
- where a surface ends, such as `outlined` or `plain` on a Card
|
|
40
|
+
- how much ink a control uses, such as `ghost` or `solid` on a Button
|
|
41
|
+
- which widget is rendered, such as `segmented` or `underlined` on Tabs
|
|
42
|
+
- in one case, a tone filed in the wrong place
|
|
43
|
+
|
|
44
|
+
`outlined` appeared in two of those groups with different meanings. On a Card,
|
|
45
|
+
it set where the surface ends. On a Button, it set how much ink the button uses.
|
|
46
|
+
With one attribute for both, you could not set one without also setting the
|
|
44
47
|
other.
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
**Helix does not accept `appearance`.** A component that adds it back fails the
|
|
50
|
+
build.
|
|
48
51
|
|
|
49
|
-
##
|
|
52
|
+
## When a property needs two axes
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
**If two values can apply at the same time, they belong on two axes.**
|
|
55
|
+
`Megamenu` is the example. `variant="band"` sets the layout of its panel, and
|
|
56
|
+
glass is a `material`. A panel can be a band and glass at once, so the two
|
|
57
|
+
values sit on two axes. A panel can also be glass and outlined at once.
|
|
54
58
|
|
|
55
|
-
If you are adding a property and cannot decide which axis it belongs
|
|
56
|
-
usually
|
|
59
|
+
If you are adding a property and cannot decide which axis it belongs on, it is
|
|
60
|
+
usually two properties.
|
|
57
61
|
|
|
58
|
-
## `variant`
|
|
62
|
+
## Use `variant` for a choice between widgets
|
|
59
63
|
|
|
60
64
|
```html
|
|
61
65
|
<helix-tabs variant="segmented">…</helix-tabs>
|
|
62
66
|
<helix-time-picker variant="wheels">…</helix-time-picker>
|
|
63
67
|
```
|
|
64
68
|
|
|
65
|
-
`variant`
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
`variant` has no registry, because its values belong to one component. For
|
|
70
|
+
example:
|
|
71
|
+
|
|
72
|
+
- `segmented` or `underlined`
|
|
73
|
+
- `list` or `wheels`
|
|
74
|
+
- `grip` or `line`
|
|
75
|
+
|
|
76
|
+
A variant is a choice between two widgets. That choice changes structure
|
|
77
|
+
wherever it is made, so `variant` can appear on either tier.
|
|
69
78
|
|
|
70
|
-
**
|
|
71
|
-
|
|
79
|
+
**Do not use `variant` for anything an axis already covers.** That is the
|
|
80
|
+
problem `appearance` had.
|
|
72
81
|
|
|
73
|
-
##
|
|
82
|
+
## Axes on both tiers
|
|
74
83
|
|
|
75
|
-
|
|
76
|
-
no box to size. The exceptions are the axes that are not
|
|
77
|
-
|
|
78
|
-
what gets *rendered*: a meter at `ring` emits an arc rather than a bar, so the
|
|
79
|
-
markup differs before any rule is written. `nesting` says what depth *is*: a
|
|
80
|
-
tree at `subordinate` ranks its rows, a tree at `heading` makes each branch the
|
|
81
|
-
name of the list under it, a file explorer does neither, and that is true of a
|
|
82
|
-
tree nobody has styled. `orientation` is `shape`'s reason again: `aria-orientation`
|
|
83
|
-
is markup, and the toolbar, the splitter, the divider and the table column all
|
|
84
|
-
write it with nothing painted.
|
|
84
|
+
Styled axes do not appear on the headless tier, because the headless tier has
|
|
85
|
+
nothing to paint and no box to size. The exceptions are the axes that are not
|
|
86
|
+
about paint:
|
|
85
87
|
|
|
86
|
-
`
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
- `tone` sets what a thing means, and that meaning holds without a stylesheet.
|
|
89
|
+
- `shape` sets what is rendered. A meter at `ring` renders an arc where it would
|
|
90
|
+
otherwise render a bar, so the markup differs before any CSS rule is written.
|
|
91
|
+
- `nesting` sets what depth means. A tree at `subordinate` ranks its rows. A
|
|
92
|
+
tree at `heading` makes each branch the name of the list under it. A file
|
|
93
|
+
explorer does neither. All of this holds for a tree with no styles.
|
|
94
|
+
- `orientation` is on both tiers for the same reason as `shape`.
|
|
95
|
+
`aria-orientation` is markup, and the toolbar, the splitter, the divider, and
|
|
96
|
+
the table column all write it with nothing painted.
|
|
97
|
+
|
|
98
|
+
`size` is the opposite case. Pictures and regions take a `size`. Controls do
|
|
99
|
+
not, because they take their height from their region through `data-density`.
|
|
100
|
+
So `size` appears only where something is painted.
|
|
89
101
|
|
|
90
102
|
## When a family takes `neutral`
|
|
91
103
|
|
|
92
|
-
`tone` is the one axis whose
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
belongs here once instead.
|
|
104
|
+
`tone` is the one axis whose values the table above does not list in full.
|
|
105
|
+
Families have decided one at a time whether to accept `neutral`. Three of them
|
|
106
|
+
reached the same rule in their own declarations, so the rule is stated here.
|
|
96
107
|
|
|
97
|
-
**A family that reports a status
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
108
|
+
**A family that reports a status accepts only the status values.** `Callout` and
|
|
109
|
+
`Toast` both state this. A callout reports a status and never a brand role, so
|
|
110
|
+
it accepts four of the seven tones. There is no neutral status. Accepting a
|
|
111
|
+
value the family cannot draw is worse than leaving the value out.
|
|
101
112
|
|
|
102
|
-
**A family whose resting state
|
|
103
|
-
gives
|
|
104
|
-
would fall
|
|
105
|
-
nothing.
|
|
113
|
+
**A family whose resting state has no tone does not need `neutral`.** `Text`
|
|
114
|
+
gives this reason for having no `default` value. A value that matches no rule
|
|
115
|
+
would fall back to the inherited ink. It would look like it works and change
|
|
116
|
+
nothing. Leaving the attribute off already gives the resting state.
|
|
106
117
|
|
|
107
|
-
|
|
108
|
-
tag beside six colored ones, a button that is
|
|
109
|
-
action. `Announcement`
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
**Use `neutral` for something that has a tone but reports no status.** Examples
|
|
119
|
+
are a gray tag beside six colored ones, or a button that is not the primary
|
|
120
|
+
action. `Announcement` accepts `neutral` as a value you write, so you can set
|
|
121
|
+
the untoned look by name. Leaving the attribute off would give the same look
|
|
122
|
+
without a name. That is the only reason to accept this value.
|
|
112
123
|
|
|
113
|
-
## What each shape
|
|
124
|
+
## What each shape draws
|
|
114
125
|
|
|
115
|
-
`shape`
|
|
116
|
-
not on a page, so it is worth saying what each one draws.
|
|
126
|
+
Several `shape` values sound alike and draw different geometries:
|
|
117
127
|
|
|
118
128
|
| Value | What it draws |
|
|
119
129
|
|---|---|
|
|
120
130
|
| `arc` | An open curve, a gauge that stops short of a full turn |
|
|
121
|
-
| `circle` | A full
|
|
122
|
-
| `diamond` | A square turned on its point, its corners at the middles of the box's sides,
|
|
123
|
-
| `dots` | Separate marks
|
|
131
|
+
| `circle` | A full circle, with the whole edge at `radii-full` |
|
|
132
|
+
| `diamond` | A square turned on its point, with its corners at the middles of the box's sides, like a flowchart's decision step |
|
|
133
|
+
| `dots` | Separate marks, with nothing joining them |
|
|
124
134
|
| `pill` | A rectangle whose short ends are half-circles, the round of `radii-full` on a box wider than it is tall |
|
|
135
|
+
| `pin` | A teardrop that marks a place with its tip, such as where a journey ends on a map |
|
|
125
136
|
| `ring` | A closed curve, the whole turn drawn as a band |
|
|
126
137
|
| `rounded` | Corners cut to `radii-md`, still a rectangle |
|
|
127
|
-
| `square` | Sharp corners, the
|
|
128
|
-
| `text` |
|
|
138
|
+
| `square` | Sharp corners, the shape `rounded` softens |
|
|
139
|
+
| `text` | The shape of a line of text, as wide and as tall as one line |
|
|
129
140
|
|
|
130
|
-
**`square`
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
141
|
+
**`square` has sharp corners, and `rounded` has corners cut to `radii-md`.**
|
|
142
|
+
They were once one word. An avatar drawing `radii-md` called its shape `square`,
|
|
143
|
+
and a QR code drawing sharp modules also called its shape `square`, on the same
|
|
144
|
+
registered axis. A check can confirm only that a value is in the registry, so no
|
|
145
|
+
check could catch this. The table above keeps it from happening again.
|
|
134
146
|
|
|
135
147
|
## What each separation draws
|
|
136
148
|
|
|
137
|
-
`separation`
|
|
138
|
-
|
|
139
|
-
omission is about.
|
|
149
|
+
`separation` sets where a box ends. Nearly every family leaves out `elevated`,
|
|
150
|
+
and this section explains why.
|
|
140
151
|
|
|
141
152
|
| Value | What it draws |
|
|
142
153
|
|---|---|
|
|
@@ -145,35 +156,42 @@ omission is about.
|
|
|
145
156
|
| `outlined` | An edge over the ground it already has |
|
|
146
157
|
| `plain` | Neither, so the box ends where its content does |
|
|
147
158
|
|
|
148
|
-
**
|
|
149
|
-
that
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
a
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
**Most families leave out `elevated` because of what the value means.** A shadow
|
|
160
|
+
shows that the box floats above the page. That is true of a card picked up off a
|
|
161
|
+
grid and of an announcement laid over the content. It is false of:
|
|
162
|
+
|
|
163
|
+
- a row in a feed
|
|
164
|
+
- a groove a thumb sits in
|
|
165
|
+
- a checkbox
|
|
166
|
+
- a bar across a video
|
|
155
167
|
|
|
156
|
-
|
|
168
|
+
A family that accepts only the other three values needs no reason for it. A
|
|
169
|
+
family that accepts `elevated` has made a choice, and `Card` and `Announcement`
|
|
170
|
+
both accept it.
|
|
157
171
|
|
|
158
|
-
|
|
159
|
-
|
|
172
|
+
## What each nesting value does
|
|
173
|
+
|
|
174
|
+
The three `nesting` values are three ways to show the same depth in a tree.
|
|
175
|
+
Each suits a different kind of tree.
|
|
160
176
|
|
|
161
177
|
| Value | The tree it suits | What moves |
|
|
162
178
|
|---|---|---|
|
|
163
179
|
| `heading` | A documentation sidebar, where a branch names the list it holds and is not a page | The branch, which takes the rail heading. Its children keep the row they had |
|
|
164
|
-
| `peer` | A file explorer, where every row is the same kind of thing | Nothing.
|
|
180
|
+
| `peer` | A file explorer, where every row is the same kind of thing | Nothing. Only the indent shows depth |
|
|
165
181
|
| `subordinate` | Side navigation, a categorization, a facet list | The nested row, one step down the type scale and no further |
|
|
166
182
|
|
|
167
|
-
`heading` and `subordinate`
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
183
|
+
`heading` and `subordinate` work differently. `subordinate` depends on depth and
|
|
184
|
+
makes the child quieter. `heading` depends on whether a row has children and
|
|
185
|
+
turns the parent into a heading. As a result:
|
|
186
|
+
|
|
187
|
+
- Under `heading`, a branch at any depth is a heading.
|
|
188
|
+
- Under `subordinate`, the step down stops after one level.
|
|
189
|
+
- Both leave a top-level leaf beside a branch alone, for opposite reasons.
|
|
172
190
|
|
|
173
|
-
## What each emphasis
|
|
191
|
+
## What each emphasis draws
|
|
174
192
|
|
|
175
|
-
`emphasis`
|
|
176
|
-
|
|
193
|
+
`emphasis` sets how prominent a control is. Its values form one ladder, and one
|
|
194
|
+
value changes meaning partway along.
|
|
177
195
|
|
|
178
196
|
| Value | What it draws |
|
|
179
197
|
|---|---|
|
|
@@ -183,21 +201,23 @@ that changes meaning halfway along, so it is worth saying what each draws.
|
|
|
183
201
|
| `ghost` | Nothing at rest, the tone carried by the ink alone |
|
|
184
202
|
| `muted` | Quieter ink, where there is no surface to quiet |
|
|
185
203
|
|
|
186
|
-
**`outlined` is the
|
|
187
|
-
fill
|
|
188
|
-
fill stays under the edge, because
|
|
189
|
-
|
|
190
|
-
|
|
204
|
+
**`outlined` is the value that changes meaning.** On a control, it adds an edge
|
|
205
|
+
and removes the fill, which makes it quieter than `solid`. On a chart mark, the
|
|
206
|
+
fill stays under the edge, because the area shows a value and removing the fill
|
|
207
|
+
would hide that value. In both cases, `outlined` sets how much ink the element
|
|
208
|
+
uses, based on what the element needs the ink for.
|
|
191
209
|
|
|
192
|
-
**`muted` is for
|
|
193
|
-
|
|
194
|
-
|
|
210
|
+
**`muted` is for something whose only ink is its letterforms.** Only text takes
|
|
211
|
+
it, because everything else has a surface to make quieter first. Leaving it off
|
|
212
|
+
other families is intentional.
|
|
195
213
|
|
|
196
|
-
## What each material
|
|
214
|
+
## What each material draws
|
|
197
215
|
|
|
198
|
-
`material`
|
|
199
|
-
|
|
200
|
-
|
|
216
|
+
Each `material` value sets two declarations together: a translucent ground and a
|
|
217
|
+
backdrop filter. The three values set that pair at different strengths. They
|
|
218
|
+
work only as a pair. A translucent ground without a backdrop filter looks
|
|
219
|
+
smeared, and a filter behind an opaque ground cannot be seen. With no
|
|
220
|
+
`material`, a surface is opaque.
|
|
201
221
|
|
|
202
222
|
| Value | What it draws |
|
|
203
223
|
|---|---|
|
|
@@ -205,51 +225,53 @@ behind an opaque ground is invisible. Absent is opaque.
|
|
|
205
225
|
| `frosted` | The same pair turned up, a heavier ground under a heavier blur |
|
|
206
226
|
| `transparent` | Neither, so the page shows through structure and spacing |
|
|
207
227
|
|
|
208
|
-
`frosted`
|
|
209
|
-
|
|
210
|
-
|
|
228
|
+
Use `frosted` for a surface that has to stay readable over a busy page. A theme
|
|
229
|
+
sets how strong each pair is. The three values choose which pair a surface uses.
|
|
230
|
+
|
|
231
|
+
## What each orientation does
|
|
232
|
+
|
|
233
|
+
A component reads `orientation` as a value, because it changes more than paint.
|
|
234
|
+
It turns:
|
|
211
235
|
|
|
212
|
-
|
|
236
|
+
- the drag axis
|
|
237
|
+
- the arrow keys
|
|
238
|
+
- `aria-orientation`
|
|
213
239
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
`aria-orientation` all turn with it, and a CSS-only version would look stacked
|
|
217
|
-
while behaving side by side, with the keyboard moving the wrong way.
|
|
240
|
+
A version done only in CSS would look stacked while behaving side by side, and
|
|
241
|
+
the arrow keys would move the wrong way.
|
|
218
242
|
|
|
219
243
|
| Value | What it does |
|
|
220
244
|
|---|---|
|
|
221
|
-
| `horizontal` | Lays along the inline axis and
|
|
222
|
-
| `vertical` |
|
|
223
|
-
| `auto` |
|
|
245
|
+
| `horizontal` | Lays out along the inline axis and sets `aria-orientation` to match |
|
|
246
|
+
| `vertical` | Lays out along the block axis and sets `aria-orientation` to match |
|
|
247
|
+
| `auto` | Picks a direction from the room the component has, and turns again when that changes |
|
|
224
248
|
|
|
225
|
-
**`auto`
|
|
226
|
-
300px panel of a 1400px window has no room for two panes side by side
|
|
227
|
-
|
|
228
|
-
|
|
249
|
+
**`auto` uses the component's own width, never the viewport's.** A splitter in a
|
|
250
|
+
300px panel of a 1400px window has no room for two panes side by side. A media
|
|
251
|
+
query would give it the desktop layout. A `ResizeObserver` on the host measures
|
|
252
|
+
the width the splitter actually has.
|
|
229
253
|
|
|
230
|
-
## What each size
|
|
254
|
+
## What each size draws
|
|
231
255
|
|
|
232
|
-
`size`
|
|
233
|
-
|
|
234
|
-
of the four is not a rung of the same kind.
|
|
256
|
+
`size` applies to pictures and regions, and never to controls. That rule sets
|
|
257
|
+
the scope of the axis. One of the four values is a different kind of step.
|
|
235
258
|
|
|
236
259
|
| Value | What it draws |
|
|
237
260
|
|---|---|
|
|
238
|
-
| `sm` | The small
|
|
239
|
-
| `md` | The middle
|
|
240
|
-
| `lg` | The large
|
|
241
|
-
| `full` | The region less the same inset every
|
|
261
|
+
| `sm` | The small step |
|
|
262
|
+
| `md` | The middle step, and the resting state for a family that has one |
|
|
263
|
+
| `lg` | The large step |
|
|
264
|
+
| `full` | The whole region, less the same inset every other step already leaves |
|
|
242
265
|
|
|
243
|
-
**`full` is one more
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
266
|
+
**`full` is one more step on the `size` axis.** A takeover dialog is the same
|
|
267
|
+
setting taken further, so it belongs on this axis. A separate `fullscreen`
|
|
268
|
+
boolean would be one component's own way to set a value the registry already
|
|
269
|
+
covers.
|
|
247
270
|
|
|
248
271
|
## What each tone means
|
|
249
272
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
all of them. The seven are still fixed, and this is where they are said.
|
|
273
|
+
The table at the top describes `tone` in words and names four of its values.
|
|
274
|
+
`tone` has seven fixed values:
|
|
253
275
|
|
|
254
276
|
| Value | What it means |
|
|
255
277
|
|---|---|
|
|
@@ -261,20 +283,20 @@ all of them. The seven are still fixed, and this is where they are said.
|
|
|
261
283
|
| `warning` | May go wrong, or needs attention before it does |
|
|
262
284
|
| `danger` | Destructive, or already wrong |
|
|
263
285
|
|
|
264
|
-
The first three are
|
|
265
|
-
|
|
266
|
-
|
|
286
|
+
The first three are intents, and the last four are statuses. A family that
|
|
287
|
+
accepts a subset is choosing between these two groups. The section on `neutral`
|
|
288
|
+
above says when to accept it.
|
|
267
289
|
|
|
268
|
-
## What each width
|
|
290
|
+
## What each width value does
|
|
269
291
|
|
|
270
|
-
`width`
|
|
271
|
-
|
|
292
|
+
`width` sets a policy. Two buttons placed together can have different widths.
|
|
293
|
+
By the same test that keeps height off each control, width belongs on each
|
|
294
|
+
component, separate from `size`.
|
|
272
295
|
|
|
273
296
|
| Value | What it draws |
|
|
274
297
|
|---|---|
|
|
275
|
-
| `auto` | As wide as its content
|
|
276
|
-
| `full` |
|
|
298
|
+
| `auto` | As wide as its content. This is the resting behavior, written out |
|
|
299
|
+
| `full` | All the inline space its parent gives it |
|
|
277
300
|
|
|
278
|
-
**A `width`
|
|
279
|
-
canvas and a table column
|
|
280
|
-
a length and are not on this axis. The name is shared and the question is not.
|
|
301
|
+
**A `width` that takes a number is a different property with the same name.** A
|
|
302
|
+
canvas and a table column take a length, so they are not on this axis.
|
package/content/vue.mdx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: The
|
|
2
|
+
description: The compiler setting Vue needs, and how Vue passes props and binds events.
|
|
3
3
|
parent: installation
|
|
4
4
|
section: Getting started
|
|
5
5
|
title: Vue
|
|
@@ -11,15 +11,15 @@ title: Vue
|
|
|
11
11
|
import '@fusion.dev/helix/vue'
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
tag
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
Add this types-only import once. It augments Vue's `GlobalComponents`, so every
|
|
15
|
+
Helix tag in an SFC template has typed props and events. The generated file
|
|
16
|
+
declares the augmentation under both `vue` and `@vue/runtime-core`, because
|
|
17
|
+
different tools read different ones.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Mark Helix tags as custom elements
|
|
20
20
|
|
|
21
|
-
Without this, Vue
|
|
22
|
-
|
|
21
|
+
Without this setting, Vue treats `<helix-button>` as a component it cannot find
|
|
22
|
+
and logs a warning on every render.
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
25
|
// vite.config.ts
|
|
@@ -32,37 +32,37 @@ export default defineConfig({
|
|
|
32
32
|
})
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
The prefix test is
|
|
36
|
-
|
|
35
|
+
The prefix test is enough. Every Helix element name starts with `helix-`, in
|
|
36
|
+
both tiers, and no other name in the library does.
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## Pass props and bind events
|
|
39
39
|
|
|
40
|
-
Vue sets a property when the element has one and
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
Vue sets a property when the element has one, and sets an attribute otherwise.
|
|
41
|
+
That works for every Helix element. A string goes through either path, and an
|
|
42
|
+
array or an object goes through the property.
|
|
43
43
|
|
|
44
44
|
```vue
|
|
45
45
|
<helix-tabs :items="items" @helix-before-activate="onActivate" />
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
`@helix-before-activate` binds with `addEventListener`, so
|
|
49
|
-
Vue
|
|
50
|
-
|
|
48
|
+
`@helix-before-activate` binds with `addEventListener`, so use the event's own
|
|
49
|
+
name. Vue needs no bridge and no wrapper. The compiler setting above is the only
|
|
50
|
+
setup.
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
To force a property, use `.prop`. You may need it where a string would be
|
|
53
|
+
ambiguous:
|
|
54
54
|
|
|
55
55
|
```vue
|
|
56
56
|
<helix-input :value.prop="'42'" />
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
You will rarely need `.prop`.
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Seed, mirror, or refuse a value
|
|
62
62
|
|
|
63
|
-
`value`, `open`, `checked
|
|
64
|
-
|
|
65
|
-
control](./state-and-control).
|
|
63
|
+
`value`, `open`, `checked`, and `active` are seeds. The element starts with the
|
|
64
|
+
value you set and then applies its own changes, so all three of these patterns
|
|
65
|
+
work. See [State and control](./state-and-control).
|
|
66
66
|
|
|
67
67
|
```vue
|
|
68
68
|
<!-- Seeded: the element owns it from there. -->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Use the Helix styles on a page with no build step, and why the elements need a bundler for now.
|
|
3
3
|
parent: installation
|
|
4
4
|
section: Getting started
|
|
5
5
|
title: Without a bundler
|
|
@@ -8,10 +8,10 @@ trailing: true
|
|
|
8
8
|
|
|
9
9
|
# Without a bundler
|
|
10
10
|
|
|
11
|
-
Helix ships standard ES modules and plain CSS files
|
|
12
|
-
|
|
11
|
+
Helix ships standard ES modules and plain CSS files. On a page with no build
|
|
12
|
+
step, you can use the Helix styles. The elements need a bundler for now.
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Use the styles alone
|
|
15
15
|
|
|
16
16
|
```html
|
|
17
17
|
<link
|
|
@@ -20,22 +20,39 @@ no build step at all. Two ways, and they suit different things.
|
|
|
20
20
|
/>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
`helix.css`
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
23
|
+
`helix.css` imports four files in the order they must load:
|
|
24
|
+
|
|
25
|
+
1. `primitives.css`
|
|
26
|
+
2. `tokens.css`
|
|
27
|
+
3. `base.css`
|
|
28
|
+
4. `elements.css`
|
|
29
|
+
|
|
30
|
+
Its `@import`s are relative, so a browser resolves them against the stylesheet's
|
|
31
|
+
own URL. Copy the whole `dist` folder and link `helix.css`. We checked this in
|
|
32
|
+
Chromium: one `<link>` makes five requests, and every layer resolves.
|
|
33
|
+
|
|
34
|
+
*Until August 24, 2026, this page listed `tokens.css` and `base.css` without
|
|
35
|
+
`primitives.css`. `tokens.css` refers to a primitive 297 times and imports
|
|
36
|
+
nothing. If you followed the old instructions, all 185 semantic tokens are
|
|
37
|
+
declared and every color resolves to `rgba(0, 0, 0, 0)`. If your page looks
|
|
38
|
+
unstyled in that way, link `helix.css`.*
|
|
39
|
+
|
|
40
|
+
`elements.css` matters most on a page with no bundler. Without a bundler, the
|
|
41
|
+
module graph loads over the network, so the markup is on the page longer before
|
|
42
|
+
the element definitions arrive. `elements.css` is the fourth layer that
|
|
43
|
+
`helix.css` imports. It used to be a second link, and moving it into the same
|
|
44
|
+
package made its import relative. Only a bundler resolves a bare specifier in an
|
|
45
|
+
`@import`, so a bare specifier would not work on a page with no bundler.
|
|
46
|
+
|
|
47
|
+
## The elements need a bundler
|
|
48
|
+
|
|
49
|
+
`@fusion.dev/helix` imports its dependencies by bare specifiers, such as
|
|
50
|
+
`@fusion.dev/helix-core` and `lit`. A browser resolves a bare specifier only
|
|
51
|
+
through an import map, and the elements import 97 separate subpaths of
|
|
52
|
+
`@fusion.dev/helix-headless`. An import map would need an entry for each one,
|
|
53
|
+
and for each subpath of `lit`.
|
|
54
|
+
|
|
55
|
+
To use the elements, load them through a bundler, as
|
|
56
|
+
[Installation](./installation) shows. A CDN that rewrites bare specifiers into
|
|
57
|
+
URLs can serve the elements to a page with no build step, once the packages are
|
|
58
|
+
public on npm.
|