@fusion.dev/helix-docs 0.139.0 → 0.141.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/color.mdx +10 -5
- package/content/intent-reference.mdx +15 -6
- package/content/maps.mdx +3 -3
- package/content/metrics.mdx +226 -226
- package/content/surfaces-and-separation.mdx +1 -1
- package/content/theme-builder.mdx +5 -0
- package/content/theming.mdx +33 -4
- package/dist/sources.generated.js +293 -245
- package/package.json +9 -9
|
@@ -30,6 +30,11 @@ drawn with the theme, and the stylesheet the theme generates beside it.
|
|
|
30
30
|
The Color scheme field picks which half you see: light, dark, or the site's own
|
|
31
31
|
mode. See [Color modes](./color-modes).
|
|
32
32
|
|
|
33
|
+
The builder starts from ink, the palette Helix draws with no brand color:
|
|
34
|
+
near-black in light mode and near-white in dark. Turn on **Brand color** to
|
|
35
|
+
derive the palette from a color of your own. The accent angle is measured from
|
|
36
|
+
the brand, so it applies only with one.
|
|
37
|
+
|
|
33
38
|
## A page of your own color
|
|
34
39
|
|
|
35
40
|
The Light page and Dark page fields give the page a color, such as a warm cream
|
package/content/theming.mdx
CHANGED
|
@@ -8,6 +8,22 @@ title: Deriving a theme
|
|
|
8
8
|
|
|
9
9
|
Helix computes your color tokens from a few inputs, such as your brand color.
|
|
10
10
|
|
|
11
|
+
## Without a brand color
|
|
12
|
+
|
|
13
|
+
With no brand color set, Helix draws in ink. The primary color is near-black in
|
|
14
|
+
light mode and near-white in dark mode, and a filled button is the opposite of
|
|
15
|
+
the page, with the page's own color for its label. The neutral ramp supplies
|
|
16
|
+
both, so a gray with a tint gives a tinted ink. Set a brand color to replace the
|
|
17
|
+
ink, as a seed in CSS or as `brand` in the theme engine.
|
|
18
|
+
|
|
19
|
+
Before ink, the default was a blue. To keep it, set it as your seed:
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
:root {
|
|
23
|
+
--helix-seed-brand: oklch(0.539 0.19 258);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
11
27
|
When a design system ships two hundred fixed color values, you theme it by
|
|
12
28
|
changing them one at a time. A change to one value can break the contrast of a
|
|
13
29
|
component elsewhere, and nothing tells you.
|
|
@@ -38,8 +54,9 @@ resolved at the root. The stylesheet declares the ramp again on each
|
|
|
38
54
|
|
|
39
55
|
Tuned does not guarantee contrast. CSS has no contrast function.
|
|
40
56
|
`oklch(from …)` can step and rotate a color, but it cannot search for the
|
|
41
|
-
lightness that meets a target. The contrast figures built into the ramp
|
|
42
|
-
exact for
|
|
57
|
+
lightness that meets a target. The contrast figures built into the ramp were
|
|
58
|
+
measured on one blue seed, so they are exact for that seed and approximate for
|
|
59
|
+
any other.
|
|
43
60
|
|
|
44
61
|
**Verified** uses the theme engine. It searches for each color that meets its
|
|
45
62
|
target, measures every pair, and returns the theme with any violations:
|
|
@@ -110,6 +127,16 @@ console.log(css[':root'])
|
|
|
110
127
|
A value that is not a color and still changes with the mode, such as the edge
|
|
111
128
|
of a floating surface, is set by rules after the block, one for each mode.
|
|
112
129
|
|
|
130
|
+
The CLI writes the same block. `helix theme init` writes a `helix.theme.json`,
|
|
131
|
+
with your brand color if you pass `--brand`. `helix theme build` derives it in
|
|
132
|
+
both modes, unless the file names a `scheme`, and refuses to write a theme with
|
|
133
|
+
a pair that misses its target:
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
helix theme init --brand '#0b3d91'
|
|
137
|
+
helix theme build --out theme.css
|
|
138
|
+
```
|
|
139
|
+
|
|
113
140
|
## Color one section
|
|
114
141
|
|
|
115
142
|
A section in a color of its own, such as a deep teal band on a cream page, is a
|
|
@@ -149,8 +176,10 @@ Equal numeric steps in sRGB do not look like equal steps. That makes scales and
|
|
|
149
176
|
contrast math in sRGB unreliable. Helix computes themes in OKLCH for this
|
|
150
177
|
reason. Colors are written in OKLCH and converted to other formats on output.
|
|
151
178
|
|
|
152
|
-
The engine keeps your brand color's hue and chroma
|
|
153
|
-
|
|
179
|
+
The engine keeps your brand color's hue and chroma. Where the color already
|
|
180
|
+
meets the contrast target, the engine uses it as it is: a navy brand stays navy
|
|
181
|
+
on a light page. Where it does not, the engine changes only its lightness, by as
|
|
182
|
+
little as the target needs. Your brand color stays recognizable, and its
|
|
154
183
|
contrast is guaranteed.
|
|
155
184
|
|
|
156
185
|
## Errors the engine prevents
|