@aitrien/motifspec 1.13.0 → 1.13.3
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 +275 -257
- package/LICENSE +21 -21
- package/README.md +128 -150
- package/dist/backdrop.html +1 -1
- package/dist/chroma.css +36 -36
- package/dist/codex.css +1145 -1145
- package/dist/codex.js +126 -126
- package/dist/contrast.md +101 -101
- package/dist/fonts.css +3 -3
- package/dist/icons.svg +18 -18
- package/dist/plate.html +1 -1
- package/dist/plate.js +292 -292
- package/dist/theme-init.js +1 -1
- package/dist/tokens.css +466 -466
- package/dist/tokens.js +3330 -3330
- package/dist/tokens.json +3330 -3330
- package/docs/components/_template.md +37 -37
- package/docs/components/accession-label.md +106 -106
- package/docs/components/backdrop.md +83 -83
- package/docs/components/button-and-link.md +87 -87
- package/docs/components/callout.md +75 -75
- package/docs/components/code-block.md +109 -109
- package/docs/components/data-table.md +73 -73
- package/docs/components/figure.md +68 -68
- package/docs/components/heading-anchor.md +76 -76
- package/docs/components/icon.md +63 -63
- package/docs/components/ornament.md +77 -77
- package/docs/components/pagination.md +78 -78
- package/docs/components/post-list-item.md +91 -91
- package/docs/components/project-card.md +82 -82
- package/docs/components/prose.md +122 -122
- package/docs/components/site-footer.md +99 -99
- package/docs/components/site-header.md +133 -133
- package/docs/components/specimen-plate.md +92 -92
- package/docs/components/table-of-contents.md +83 -83
- package/docs/components/tag.md +70 -70
- package/docs/components/tooltip.md +67 -67
- package/docs/hugo.md +132 -120
- package/docs/syntax-highlighting.md +55 -55
- package/docs/templates.md +21 -30
- package/fonts/OFL-jetbrains-mono.txt +93 -93
- package/fonts/OFL-national-park.txt +93 -93
- package/fonts/OFL-yarndings-12.txt +93 -93
- package/icons/LICENSE +202 -202
- package/icons/manifest.json +75 -75
- package/layouts/_markup/render-blockquote.html +30 -30
- package/layouts/_markup/render-codeblock.html +18 -18
- package/layouts/_markup/render-heading.html +2 -2
- package/layouts/_markup/render-image.html +14 -14
- package/layouts/_markup/render-link.html +14 -14
- package/layouts/_markup/render-table.html +31 -31
- package/layouts/_partials/motifspec/accession/id.html +2 -2
- package/layouts/_partials/motifspec/accession/label.html +18 -18
- package/layouts/_partials/motifspec/accession/status.html +2 -2
- package/layouts/_partials/motifspec/article.html +24 -24
- package/layouts/_partials/motifspec/back-link.html +2 -2
- package/layouts/_partials/motifspec/body-end.html +5 -5
- package/layouts/_partials/motifspec/body-start.html +5 -5
- package/layouts/_partials/motifspec/figure.html +14 -14
- package/layouts/_partials/motifspec/filed-under.html +5 -5
- package/layouts/_partials/motifspec/h2s.html +7 -7
- package/layouts/_partials/motifspec/head.html +15 -15
- package/layouts/_partials/motifspec/pagination-entries.html +34 -34
- package/layouts/_partials/motifspec/pagination-pages.html +30 -30
- package/layouts/_partials/motifspec/post-list-item.html +15 -15
- package/layouts/_partials/motifspec/project-card.html +23 -23
- package/layouts/_partials/motifspec/section-heading.html +3 -3
- package/layouts/_partials/motifspec/site-header.html +27 -27
- package/layouts/_partials/motifspec/table-of-contents.html +21 -21
- package/layouts/_partials/motifspec/tag-filter.html +22 -22
- package/layouts/_partials/motifspec/tags.html +8 -8
- package/layouts/_partials/motifspec/tokens.html +9 -9
- package/package.json +68 -68
- package/scripts/check.mjs +153 -153
- package/scripts/lib.mjs +176 -176
- package/tokens/README.md +3 -3
- package/tokens/border.json +63 -63
- package/tokens/color.json +1902 -1902
- package/tokens/motion.json +207 -207
- package/tokens/radius.json +53 -53
- package/tokens/size.json +378 -378
- package/tokens/space.json +289 -289
- package/tokens/typography.json +859 -859
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: heading-anchor
|
|
3
|
-
status: stable
|
|
4
|
-
tokens:
|
|
5
|
-
- border.focus.offset
|
|
6
|
-
- border.focus.width
|
|
7
|
-
- color.focus.ring
|
|
8
|
-
- color.surface.hover
|
|
9
|
-
- color.text.muted
|
|
10
|
-
- color.text.primary
|
|
11
|
-
- font.family.mono
|
|
12
|
-
- font.line-height.ui
|
|
13
|
-
- font.size.small
|
|
14
|
-
- font.tracking.body
|
|
15
|
-
- font.weight.ui
|
|
16
|
-
- motion.duration.fast
|
|
17
|
-
- motion.easing.standard
|
|
18
|
-
- radius.pill
|
|
19
|
-
- size.icon.lg
|
|
20
|
-
- size.target.touch
|
|
21
|
-
- space.inline.xs
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
# Heading anchor
|
|
25
|
-
|
|
26
|
-
A "#" link after a section heading, so readers can copy a link straight to that section.
|
|
27
|
-
|
|
28
|
-
## When to use
|
|
29
|
-
|
|
30
|
-
- On every `<h2>` that has an id: prose sections in posts and case studies, top-level sections of index and docs pages.
|
|
31
|
-
- On `<h3>` in long documentation where readers link to sub-sections.
|
|
32
|
-
|
|
33
|
-
## When not to use
|
|
34
|
-
|
|
35
|
-
- On the page `<h1>`; the page URL already points there.
|
|
36
|
-
- On headings without an id, or on card and list titles that are themselves links.
|
|
37
|
-
- On `<h4>` and below.
|
|
38
|
-
|
|
39
|
-
## Markup
|
|
40
|
-
|
|
41
|
-
```html preview
|
|
42
|
-
<!-- Prose: the heading carries the id -->
|
|
43
|
-
<h2 id="approach">Approach <a class="cx-anchor" href="#approach" aria-label="Link to Approach">#</a></h2>
|
|
44
|
-
|
|
45
|
-
<!-- Page section labelled by its heading: wrap the title text so the label excludes the anchor -->
|
|
46
|
-
<section id="components" aria-labelledby="components-title">
|
|
47
|
-
<h2><span id="components-title">Components</span> <a class="cx-anchor" href="#components" aria-label="Link to Components">#</a></h2>
|
|
48
|
-
</section>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Hugo heading render hook (`layouts/_default/_markup/render-heading.html`):
|
|
52
|
-
|
|
53
|
-
```html
|
|
54
|
-
<h{{ .Level }} id="{{ .Anchor }}">{{ .Text | safeHTML }}{{ if eq .Level 2 }} <a class="cx-anchor" href="#{{ .Anchor }}" aria-label="Link to {{ .PlainText }}">#</a>{{ end }}</h{{ .Level }}>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Do
|
|
58
|
-
|
|
59
|
-
- Keep the 44px round hit area (`size.target.touch`, `radius.pill`), the same shape as the theme toggle. It shows `color.surface.hover` behind the "#" on hover; the negative block margins stop it from changing the heading's line height.
|
|
60
|
-
|
|
61
|
-
- Put the anchor last in the heading, after a space, so it sits beside the final word.
|
|
62
|
-
- Name the destination in `aria-label` ("Link to Approach"), so a list of links reads clearly.
|
|
63
|
-
- Point the anchor at the section's own id. When a `<section>` holds the id, link to the section.
|
|
64
|
-
|
|
65
|
-
## Don't
|
|
66
|
-
|
|
67
|
-
- Don't replace "#" with an icon or ornament.
|
|
68
|
-
- Don't let the anchor wrap onto its own line with nothing else; keep the space before it so it moves with the last word.
|
|
69
|
-
- Don't put the anchor inside the text a `<section>`'s `aria-labelledby` points at.
|
|
70
|
-
|
|
71
|
-
## Accessibility
|
|
72
|
-
|
|
73
|
-
- It's a real link, reachable by Tab; it shows on focus as well as on hover, and stays visible on touch screens (`hover: none`).
|
|
74
|
-
- Its accessible name is the `aria-label`, not "#".
|
|
75
|
-
- The hit area is 44 × 44px, well above the 24px minimum.
|
|
76
|
-
- Pairs: `color.text.muted` on `color.surface.base` (4.5:1); on hover `color.text.primary` on `color.surface.hover` (7:1).
|
|
1
|
+
---
|
|
2
|
+
name: heading-anchor
|
|
3
|
+
status: stable
|
|
4
|
+
tokens:
|
|
5
|
+
- border.focus.offset
|
|
6
|
+
- border.focus.width
|
|
7
|
+
- color.focus.ring
|
|
8
|
+
- color.surface.hover
|
|
9
|
+
- color.text.muted
|
|
10
|
+
- color.text.primary
|
|
11
|
+
- font.family.mono
|
|
12
|
+
- font.line-height.ui
|
|
13
|
+
- font.size.small
|
|
14
|
+
- font.tracking.body
|
|
15
|
+
- font.weight.ui
|
|
16
|
+
- motion.duration.fast
|
|
17
|
+
- motion.easing.standard
|
|
18
|
+
- radius.pill
|
|
19
|
+
- size.icon.lg
|
|
20
|
+
- size.target.touch
|
|
21
|
+
- space.inline.xs
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Heading anchor
|
|
25
|
+
|
|
26
|
+
A "#" link after a section heading, so readers can copy a link straight to that section.
|
|
27
|
+
|
|
28
|
+
## When to use
|
|
29
|
+
|
|
30
|
+
- On every `<h2>` that has an id: prose sections in posts and case studies, top-level sections of index and docs pages.
|
|
31
|
+
- On `<h3>` in long documentation where readers link to sub-sections.
|
|
32
|
+
|
|
33
|
+
## When not to use
|
|
34
|
+
|
|
35
|
+
- On the page `<h1>`; the page URL already points there.
|
|
36
|
+
- On headings without an id, or on card and list titles that are themselves links.
|
|
37
|
+
- On `<h4>` and below.
|
|
38
|
+
|
|
39
|
+
## Markup
|
|
40
|
+
|
|
41
|
+
```html preview
|
|
42
|
+
<!-- Prose: the heading carries the id -->
|
|
43
|
+
<h2 id="approach">Approach <a class="cx-anchor" href="#approach" aria-label="Link to Approach">#</a></h2>
|
|
44
|
+
|
|
45
|
+
<!-- Page section labelled by its heading: wrap the title text so the label excludes the anchor -->
|
|
46
|
+
<section id="components" aria-labelledby="components-title">
|
|
47
|
+
<h2><span id="components-title">Components</span> <a class="cx-anchor" href="#components" aria-label="Link to Components">#</a></h2>
|
|
48
|
+
</section>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Hugo heading render hook (`layouts/_default/_markup/render-heading.html`):
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<h{{ .Level }} id="{{ .Anchor }}">{{ .Text | safeHTML }}{{ if eq .Level 2 }} <a class="cx-anchor" href="#{{ .Anchor }}" aria-label="Link to {{ .PlainText }}">#</a>{{ end }}</h{{ .Level }}>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Do
|
|
58
|
+
|
|
59
|
+
- Keep the 44px round hit area (`size.target.touch`, `radius.pill`), the same shape as the theme toggle. It shows `color.surface.hover` behind the "#" on hover; the negative block margins stop it from changing the heading's line height.
|
|
60
|
+
|
|
61
|
+
- Put the anchor last in the heading, after a space, so it sits beside the final word.
|
|
62
|
+
- Name the destination in `aria-label` ("Link to Approach"), so a list of links reads clearly.
|
|
63
|
+
- Point the anchor at the section's own id. When a `<section>` holds the id, link to the section.
|
|
64
|
+
|
|
65
|
+
## Don't
|
|
66
|
+
|
|
67
|
+
- Don't replace "#" with an icon or ornament.
|
|
68
|
+
- Don't let the anchor wrap onto its own line with nothing else; keep the space before it so it moves with the last word.
|
|
69
|
+
- Don't put the anchor inside the text a `<section>`'s `aria-labelledby` points at.
|
|
70
|
+
|
|
71
|
+
## Accessibility
|
|
72
|
+
|
|
73
|
+
- It's a real link, reachable by Tab; it shows on focus as well as on hover, and stays visible on touch screens (`hover: none`).
|
|
74
|
+
- Its accessible name is the `aria-label`, not "#".
|
|
75
|
+
- The hit area is 44 × 44px, well above the 24px minimum.
|
|
76
|
+
- Pairs: `color.text.muted` on `color.surface.base` (4.5:1); on hover `color.text.primary` on `color.surface.hover` (7:1).
|
package/docs/components/icon.md
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: icon
|
|
3
|
-
status: stable
|
|
4
|
-
tokens:
|
|
5
|
-
- size.icon.lg
|
|
6
|
-
- size.icon.md
|
|
7
|
-
- size.icon.sm
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Icon
|
|
11
|
-
|
|
12
|
-
A Material Symbols glyph from the MotifSpec sprite, used to reinforce a control's direction, state or kind.
|
|
13
|
-
|
|
14
|
-
## When to use
|
|
15
|
-
|
|
16
|
-
- Only for the roles listed in `icons/manifest.json`: direction arrows on buttons, links and pagination; the theme toggle; the copy button and its confirmation; callout titles; RSS; external links; back to top; the disclosure chevron.
|
|
17
|
-
- Beside text that already says the same thing, so the icon is a second cue.
|
|
18
|
-
|
|
19
|
-
## When not to use
|
|
20
|
-
|
|
21
|
-
- As decoration, bullets or section markers. Decoration is the ornament set (Yarndings), not icons.
|
|
22
|
-
- In headings, tags, nav labels or body copy.
|
|
23
|
-
- For anything not in the manifest. A new icon is a new manifest entry and a minor version.
|
|
24
|
-
- As the only label of a control, unless the control has an accessible name (`aria-label`).
|
|
25
|
-
|
|
26
|
-
## Markup
|
|
27
|
-
|
|
28
|
-
Inline the sprite once per page, right after `<body>` (Hugo: `{{ readFile "assets/motifspec/icons.svg" | safeHTML }}` inside a hidden wrapper, or the build's inline sprite). Then reference symbols by id:
|
|
29
|
-
|
|
30
|
-
```html preview
|
|
31
|
-
<a class="cx-button cx-button--primary" href="/work/">
|
|
32
|
-
View work
|
|
33
|
-
<svg class="cx-icon cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg>
|
|
34
|
-
</a>
|
|
35
|
-
|
|
36
|
-
<p class="cx-callout__title">
|
|
37
|
-
<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-warning"></use></svg>
|
|
38
|
-
Warning
|
|
39
|
-
</p>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Sizes: `cx-icon--sm` (16px, beside label-size mono text), default (20px, in buttons and the toggle), `cx-icon--lg` (24px, a control with no visible text).
|
|
43
|
-
|
|
44
|
-
## Do
|
|
45
|
-
|
|
46
|
-
- Use Material Symbols Sharp, weight 300, unfilled. Square terminals and a light stroke match the hairline system.
|
|
47
|
-
- Let icons inherit `currentColor`, so they take the text colour of their control and switch theme with it.
|
|
48
|
-
- Put forward arrows after the text and back arrows before it.
|
|
49
|
-
- Add `cx-button__arrow` to direction arrows so they nudge by `motion.distance.nudge` on hover, in their own direction.
|
|
50
|
-
|
|
51
|
-
## Don't
|
|
52
|
-
|
|
53
|
-
- Don't use the icon font or Google's CDN. The sprite is self-hosted and only carries approved icons.
|
|
54
|
-
- Don't mix in other icon sets, filled variants or emoji.
|
|
55
|
-
- Don't colour icons separately from their text.
|
|
56
|
-
- Don't animate icons except the arrow nudge and the disclosure chevron's rotation.
|
|
57
|
-
|
|
58
|
-
## Accessibility
|
|
59
|
-
|
|
60
|
-
- Icons beside text are `aria-hidden="true"` and `focusable="false"`. The text is the name.
|
|
61
|
-
- An icon-only control carries `aria-label` and uses `cx-icon--lg` inside a 44px target (`size.target.touch`).
|
|
62
|
-
- Icons share their text's contrast pair, because they inherit `currentColor`.
|
|
63
|
-
- Material Symbols is licensed under Apache-2.0 (`icons/LICENSE`); keep the licence with the sprite.
|
|
1
|
+
---
|
|
2
|
+
name: icon
|
|
3
|
+
status: stable
|
|
4
|
+
tokens:
|
|
5
|
+
- size.icon.lg
|
|
6
|
+
- size.icon.md
|
|
7
|
+
- size.icon.sm
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Icon
|
|
11
|
+
|
|
12
|
+
A Material Symbols glyph from the MotifSpec sprite, used to reinforce a control's direction, state or kind.
|
|
13
|
+
|
|
14
|
+
## When to use
|
|
15
|
+
|
|
16
|
+
- Only for the roles listed in `icons/manifest.json`: direction arrows on buttons, links and pagination; the theme toggle; the copy button and its confirmation; callout titles; RSS; external links; back to top; the disclosure chevron.
|
|
17
|
+
- Beside text that already says the same thing, so the icon is a second cue.
|
|
18
|
+
|
|
19
|
+
## When not to use
|
|
20
|
+
|
|
21
|
+
- As decoration, bullets or section markers. Decoration is the ornament set (Yarndings), not icons.
|
|
22
|
+
- In headings, tags, nav labels or body copy.
|
|
23
|
+
- For anything not in the manifest. A new icon is a new manifest entry and a minor version.
|
|
24
|
+
- As the only label of a control, unless the control has an accessible name (`aria-label`).
|
|
25
|
+
|
|
26
|
+
## Markup
|
|
27
|
+
|
|
28
|
+
Inline the sprite once per page, right after `<body>` (Hugo: `{{ readFile "assets/motifspec/icons.svg" | safeHTML }}` inside a hidden wrapper, or the build's inline sprite). Then reference symbols by id:
|
|
29
|
+
|
|
30
|
+
```html preview
|
|
31
|
+
<a class="cx-button cx-button--primary" href="/work/">
|
|
32
|
+
View work
|
|
33
|
+
<svg class="cx-icon cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg>
|
|
34
|
+
</a>
|
|
35
|
+
|
|
36
|
+
<p class="cx-callout__title">
|
|
37
|
+
<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-warning"></use></svg>
|
|
38
|
+
Warning
|
|
39
|
+
</p>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Sizes: `cx-icon--sm` (16px, beside label-size mono text), default (20px, in buttons and the toggle), `cx-icon--lg` (24px, a control with no visible text).
|
|
43
|
+
|
|
44
|
+
## Do
|
|
45
|
+
|
|
46
|
+
- Use Material Symbols Sharp, weight 300, unfilled. Square terminals and a light stroke match the hairline system.
|
|
47
|
+
- Let icons inherit `currentColor`, so they take the text colour of their control and switch theme with it.
|
|
48
|
+
- Put forward arrows after the text and back arrows before it.
|
|
49
|
+
- Add `cx-button__arrow` to direction arrows so they nudge by `motion.distance.nudge` on hover, in their own direction.
|
|
50
|
+
|
|
51
|
+
## Don't
|
|
52
|
+
|
|
53
|
+
- Don't use the icon font or Google's CDN. The sprite is self-hosted and only carries approved icons.
|
|
54
|
+
- Don't mix in other icon sets, filled variants or emoji.
|
|
55
|
+
- Don't colour icons separately from their text.
|
|
56
|
+
- Don't animate icons except the arrow nudge and the disclosure chevron's rotation.
|
|
57
|
+
|
|
58
|
+
## Accessibility
|
|
59
|
+
|
|
60
|
+
- Icons beside text are `aria-hidden="true"` and `focusable="false"`. The text is the name.
|
|
61
|
+
- An icon-only control carries `aria-label` and uses `cx-icon--lg` inside a 44px target (`size.target.touch`).
|
|
62
|
+
- Icons share their text's contrast pair, because they inherit `currentColor`.
|
|
63
|
+
- Material Symbols is licensed under Apache-2.0 (`icons/LICENSE`); keep the licence with the sprite.
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ornament
|
|
3
|
-
status: stable
|
|
4
|
-
tokens:
|
|
5
|
-
- border.width.hairline
|
|
6
|
-
- color.border.subtle
|
|
7
|
-
- color.ornament.rest
|
|
8
|
-
- font.family.ornament
|
|
9
|
-
- font.line-height.display
|
|
10
|
-
- font.tracking.label
|
|
11
|
-
- size.ornament.lg
|
|
12
|
-
- size.ornament.md
|
|
13
|
-
- size.ornament.sm
|
|
14
|
-
- space.inline.sm
|
|
15
|
-
- space.inset.md
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
# Ornament
|
|
19
|
-
|
|
20
|
-
Yarndings 12 knitting-chart glyphs: the footer band, the prose divider, the article end mark and one empty-state glyph.
|
|
21
|
-
|
|
22
|
-
## When to use
|
|
23
|
-
|
|
24
|
-
- `cx-band`: once per page, at the top of the footer.
|
|
25
|
-
- `<hr>` in prose (or `cx-divider`): a three-stitch break between major parts.
|
|
26
|
-
- `cx-end-mark`: the flower glyph after an article's last sentence.
|
|
27
|
-
- `cx-ornament--lg`: one sprout on an empty state or 404.
|
|
28
|
-
- `cx-ornament` (with `--lg` or default size): a single glyph from the catalogue elsewhere, for example a leaf beside a colophon or a snowflake on a seasonal post.
|
|
29
|
-
|
|
30
|
-
## When not to use
|
|
31
|
-
|
|
32
|
-
- As icons, bullets, status markers or anything that carries meaning.
|
|
33
|
-
- More than one ornament group in a viewport.
|
|
34
|
-
- Glyphs in `codex.glyphs.forbidden` (`u v w x y z [ ] { }`): faces, a robot, hearts and animals read as emoji and are never allowed.
|
|
35
|
-
|
|
36
|
-
## Markup
|
|
37
|
-
|
|
38
|
-
```html preview
|
|
39
|
-
<span class="cx-band" aria-hidden="true"></span>
|
|
40
|
-
<hr class="cx-divider">
|
|
41
|
-
<p>Last sentence of the article.<span class="cx-end-mark" aria-hidden="true">g</span></p>
|
|
42
|
-
<span class="cx-ornament cx-ornament--lg" aria-hidden="true">f</span>
|
|
43
|
-
<span class="cx-ornament" aria-hidden="true">h</span> <!-- leaf -->
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## The catalogue
|
|
47
|
-
|
|
48
|
-
`font.family.ornament` → `$extensions["codex.glyphs"]` lists all 80 approved glyphs by name, with the key that types each one and its group:
|
|
49
|
-
|
|
50
|
-
| Group | Character | Examples (key) |
|
|
51
|
-
|---|---|---|
|
|
52
|
-
| botanical | Plants and flowers; the default choice | leaf `h`, sprout `f`, flower `g`, potted `c`, bloom `b`, blossom `m`, petals `P`, clover `E` |
|
|
53
|
-
| frost | Snowflakes, stars, bursts; dense, one at a time | snowflake `S`, snowflake-small `d`, burst `V`, frost `i` |
|
|
54
|
-
| stitch | Crosses, checks, small squares | band-small `k`, cross `A`, maltese `D`, checker-x `+`, knot `4`, pinwheel `>` |
|
|
55
|
-
| diamond | Diamonds and rings | diamond `–` (U+2013), diamond-nested `p`, ring `?` |
|
|
56
|
-
| mark | Corners, bars, dots, triangles | summit `·` (U+00B7), corner-top-left `/`, bar `(`, dot `.` |
|
|
57
|
-
|
|
58
|
-
`codex.glyphs.roles` fixes the glyphs for the system's own ornaments (band, divider, end mark, empty state); anything else may use any approved glyph. The showcase lists every glyph.
|
|
59
|
-
|
|
60
|
-
## Do
|
|
61
|
-
|
|
62
|
-
- Size glyphs on the 12px stitch grid (`size.ornament.sm`, `.md`, `.lg`).
|
|
63
|
-
- Use `font-display: block` for Yarndings and preload it (11 KB), so letters never flash in its place.
|
|
64
|
-
- Colour ornaments with `color.ornament.rest`.
|
|
65
|
-
- Refer to glyphs by catalogue name in docs and front matter (`leaf`), and look up the key, so content stays readable.
|
|
66
|
-
- Prefer botanical glyphs; mix at most two groups on a page.
|
|
67
|
-
|
|
68
|
-
## Don't
|
|
69
|
-
|
|
70
|
-
- Don't type glyphs into content where a text fallback would show letters to someone whose font failed. Use `aria-hidden` spans or generated content.
|
|
71
|
-
- Don't animate ornaments.
|
|
72
|
-
|
|
73
|
-
## Accessibility
|
|
74
|
-
|
|
75
|
-
- Every ornament is `aria-hidden="true"` or generated content with no text equivalent.
|
|
76
|
-
- `<hr>` keeps its separator role.
|
|
77
|
-
- Pair: `color.ornament.rest` on `color.surface.base` (3:1) so the band is visible, although it carries no information.
|
|
1
|
+
---
|
|
2
|
+
name: ornament
|
|
3
|
+
status: stable
|
|
4
|
+
tokens:
|
|
5
|
+
- border.width.hairline
|
|
6
|
+
- color.border.subtle
|
|
7
|
+
- color.ornament.rest
|
|
8
|
+
- font.family.ornament
|
|
9
|
+
- font.line-height.display
|
|
10
|
+
- font.tracking.label
|
|
11
|
+
- size.ornament.lg
|
|
12
|
+
- size.ornament.md
|
|
13
|
+
- size.ornament.sm
|
|
14
|
+
- space.inline.sm
|
|
15
|
+
- space.inset.md
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Ornament
|
|
19
|
+
|
|
20
|
+
Yarndings 12 knitting-chart glyphs: the footer band, the prose divider, the article end mark and one empty-state glyph.
|
|
21
|
+
|
|
22
|
+
## When to use
|
|
23
|
+
|
|
24
|
+
- `cx-band`: once per page, at the top of the footer.
|
|
25
|
+
- `<hr>` in prose (or `cx-divider`): a three-stitch break between major parts.
|
|
26
|
+
- `cx-end-mark`: the flower glyph after an article's last sentence.
|
|
27
|
+
- `cx-ornament--lg`: one sprout on an empty state or 404.
|
|
28
|
+
- `cx-ornament` (with `--lg` or default size): a single glyph from the catalogue elsewhere, for example a leaf beside a colophon or a snowflake on a seasonal post.
|
|
29
|
+
|
|
30
|
+
## When not to use
|
|
31
|
+
|
|
32
|
+
- As icons, bullets, status markers or anything that carries meaning.
|
|
33
|
+
- More than one ornament group in a viewport.
|
|
34
|
+
- Glyphs in `codex.glyphs.forbidden` (`u v w x y z [ ] { }`): faces, a robot, hearts and animals read as emoji and are never allowed.
|
|
35
|
+
|
|
36
|
+
## Markup
|
|
37
|
+
|
|
38
|
+
```html preview
|
|
39
|
+
<span class="cx-band" aria-hidden="true"></span>
|
|
40
|
+
<hr class="cx-divider">
|
|
41
|
+
<p>Last sentence of the article.<span class="cx-end-mark" aria-hidden="true">g</span></p>
|
|
42
|
+
<span class="cx-ornament cx-ornament--lg" aria-hidden="true">f</span>
|
|
43
|
+
<span class="cx-ornament" aria-hidden="true">h</span> <!-- leaf -->
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## The catalogue
|
|
47
|
+
|
|
48
|
+
`font.family.ornament` → `$extensions["codex.glyphs"]` lists all 80 approved glyphs by name, with the key that types each one and its group:
|
|
49
|
+
|
|
50
|
+
| Group | Character | Examples (key) |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| botanical | Plants and flowers; the default choice | leaf `h`, sprout `f`, flower `g`, potted `c`, bloom `b`, blossom `m`, petals `P`, clover `E` |
|
|
53
|
+
| frost | Snowflakes, stars, bursts; dense, one at a time | snowflake `S`, snowflake-small `d`, burst `V`, frost `i` |
|
|
54
|
+
| stitch | Crosses, checks, small squares | band-small `k`, cross `A`, maltese `D`, checker-x `+`, knot `4`, pinwheel `>` |
|
|
55
|
+
| diamond | Diamonds and rings | diamond `–` (U+2013), diamond-nested `p`, ring `?` |
|
|
56
|
+
| mark | Corners, bars, dots, triangles | summit `·` (U+00B7), corner-top-left `/`, bar `(`, dot `.` |
|
|
57
|
+
|
|
58
|
+
`codex.glyphs.roles` fixes the glyphs for the system's own ornaments (band, divider, end mark, empty state); anything else may use any approved glyph. The showcase lists every glyph.
|
|
59
|
+
|
|
60
|
+
## Do
|
|
61
|
+
|
|
62
|
+
- Size glyphs on the 12px stitch grid (`size.ornament.sm`, `.md`, `.lg`).
|
|
63
|
+
- Use `font-display: block` for Yarndings and preload it (11 KB), so letters never flash in its place.
|
|
64
|
+
- Colour ornaments with `color.ornament.rest`.
|
|
65
|
+
- Refer to glyphs by catalogue name in docs and front matter (`leaf`), and look up the key, so content stays readable.
|
|
66
|
+
- Prefer botanical glyphs; mix at most two groups on a page.
|
|
67
|
+
|
|
68
|
+
## Don't
|
|
69
|
+
|
|
70
|
+
- Don't type glyphs into content where a text fallback would show letters to someone whose font failed. Use `aria-hidden` spans or generated content.
|
|
71
|
+
- Don't animate ornaments.
|
|
72
|
+
|
|
73
|
+
## Accessibility
|
|
74
|
+
|
|
75
|
+
- Every ornament is `aria-hidden="true"` or generated content with no text equivalent.
|
|
76
|
+
- `<hr>` keeps its separator role.
|
|
77
|
+
- Pair: `color.ornament.rest` on `color.surface.base` (3:1) so the band is visible, although it carries no information.
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pagination
|
|
3
|
-
status: stable
|
|
4
|
-
tokens:
|
|
5
|
-
- border.focus.offset
|
|
6
|
-
- border.focus.width
|
|
7
|
-
- border.width.hairline
|
|
8
|
-
- color.border.default
|
|
9
|
-
- color.focus.ring
|
|
10
|
-
- color.surface.hover
|
|
11
|
-
- color.surface.raised
|
|
12
|
-
- color.text.accent
|
|
13
|
-
- color.text.muted
|
|
14
|
-
- color.text.primary
|
|
15
|
-
- font.family.mono
|
|
16
|
-
- font.line-height.heading
|
|
17
|
-
- font.size.label
|
|
18
|
-
- font.size.small
|
|
19
|
-
- font.tracking.label
|
|
20
|
-
- font.weight.strong
|
|
21
|
-
- font.weight.ui
|
|
22
|
-
- motion.distance.nudge
|
|
23
|
-
- motion.duration.fast
|
|
24
|
-
- motion.easing.standard
|
|
25
|
-
- size.target.touch
|
|
26
|
-
- space.inline.xs
|
|
27
|
-
- space.inset.md
|
|
28
|
-
- space.inset.sm
|
|
29
|
-
- space.stack.xs
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
# Pagination
|
|
33
|
-
|
|
34
|
-
A three-cell bar: previous with its title, current position, and next with its title.
|
|
35
|
-
|
|
36
|
-
## When to use
|
|
37
|
-
|
|
38
|
-
- At the end of a post or case study, to the previous and next entries in the collection.
|
|
39
|
-
- Below a paginated index ("Page 2 / 5"), with the page titles replaced by "Newer" and "Older".
|
|
40
|
-
|
|
41
|
-
## When not to use
|
|
42
|
-
|
|
43
|
-
- For in-page jumps; use `table-of-contents`.
|
|
44
|
-
- When there are fewer than two items to move between.
|
|
45
|
-
|
|
46
|
-
## Markup
|
|
47
|
-
|
|
48
|
-
```html preview
|
|
49
|
-
<nav class="cx-pagination" aria-label="Post navigation">
|
|
50
|
-
<a class="cx-pagination__link" href="/writing/instancing-arcs/" rel="prev">
|
|
51
|
-
<span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
|
|
52
|
-
<span class="cx-pagination__title">Instancing arcs on a WebGL globe</span>
|
|
53
|
-
</a>
|
|
54
|
-
<p class="cx-pagination__status">Post<strong>31 / 31</strong></p>
|
|
55
|
-
<span class="cx-pagination__link" rel="next" aria-disabled="true">
|
|
56
|
-
<span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
|
|
57
|
-
<span class="cx-pagination__title">Latest entry</span>
|
|
58
|
-
</span>
|
|
59
|
-
</nav>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Do
|
|
63
|
-
|
|
64
|
-
- Keep both outer cells even when one direction is missing; render it as a disabled `<span>`.
|
|
65
|
-
- Use `rel="prev"` and `rel="next"`.
|
|
66
|
-
- Put the back arrow before "Previous" and the forward arrow after "Next"; both nudge on hover.
|
|
67
|
-
|
|
68
|
-
## Don't
|
|
69
|
-
|
|
70
|
-
- Don't show numbered page lists longer than the three cells; the position cell is enough.
|
|
71
|
-
- Don't truncate titles. They wrap.
|
|
72
|
-
|
|
73
|
-
## Accessibility
|
|
74
|
-
|
|
75
|
-
- `<nav>` with a specific `aria-label` ("Post navigation", "Writing pages").
|
|
76
|
-
- Disabled ends are not links, so they're skipped by Tab.
|
|
77
|
-
- Cells are at least 44px tall.
|
|
78
|
-
- Pairs: `color.text.primary` titles on `color.surface.raised` and `color.surface.hover` (7:1); `color.text.muted` labels (4.5:1).
|
|
1
|
+
---
|
|
2
|
+
name: pagination
|
|
3
|
+
status: stable
|
|
4
|
+
tokens:
|
|
5
|
+
- border.focus.offset
|
|
6
|
+
- border.focus.width
|
|
7
|
+
- border.width.hairline
|
|
8
|
+
- color.border.default
|
|
9
|
+
- color.focus.ring
|
|
10
|
+
- color.surface.hover
|
|
11
|
+
- color.surface.raised
|
|
12
|
+
- color.text.accent
|
|
13
|
+
- color.text.muted
|
|
14
|
+
- color.text.primary
|
|
15
|
+
- font.family.mono
|
|
16
|
+
- font.line-height.heading
|
|
17
|
+
- font.size.label
|
|
18
|
+
- font.size.small
|
|
19
|
+
- font.tracking.label
|
|
20
|
+
- font.weight.strong
|
|
21
|
+
- font.weight.ui
|
|
22
|
+
- motion.distance.nudge
|
|
23
|
+
- motion.duration.fast
|
|
24
|
+
- motion.easing.standard
|
|
25
|
+
- size.target.touch
|
|
26
|
+
- space.inline.xs
|
|
27
|
+
- space.inset.md
|
|
28
|
+
- space.inset.sm
|
|
29
|
+
- space.stack.xs
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
# Pagination
|
|
33
|
+
|
|
34
|
+
A three-cell bar: previous with its title, current position, and next with its title.
|
|
35
|
+
|
|
36
|
+
## When to use
|
|
37
|
+
|
|
38
|
+
- At the end of a post or case study, to the previous and next entries in the collection.
|
|
39
|
+
- Below a paginated index ("Page 2 / 5"), with the page titles replaced by "Newer" and "Older".
|
|
40
|
+
|
|
41
|
+
## When not to use
|
|
42
|
+
|
|
43
|
+
- For in-page jumps; use `table-of-contents`.
|
|
44
|
+
- When there are fewer than two items to move between.
|
|
45
|
+
|
|
46
|
+
## Markup
|
|
47
|
+
|
|
48
|
+
```html preview
|
|
49
|
+
<nav class="cx-pagination" aria-label="Post navigation">
|
|
50
|
+
<a class="cx-pagination__link" href="/writing/instancing-arcs/" rel="prev">
|
|
51
|
+
<span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
|
|
52
|
+
<span class="cx-pagination__title">Instancing arcs on a WebGL globe</span>
|
|
53
|
+
</a>
|
|
54
|
+
<p class="cx-pagination__status">Post<strong>31 / 31</strong></p>
|
|
55
|
+
<span class="cx-pagination__link" rel="next" aria-disabled="true">
|
|
56
|
+
<span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
|
|
57
|
+
<span class="cx-pagination__title">Latest entry</span>
|
|
58
|
+
</span>
|
|
59
|
+
</nav>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Do
|
|
63
|
+
|
|
64
|
+
- Keep both outer cells even when one direction is missing; render it as a disabled `<span>`.
|
|
65
|
+
- Use `rel="prev"` and `rel="next"`.
|
|
66
|
+
- Put the back arrow before "Previous" and the forward arrow after "Next"; both nudge on hover.
|
|
67
|
+
|
|
68
|
+
## Don't
|
|
69
|
+
|
|
70
|
+
- Don't show numbered page lists longer than the three cells; the position cell is enough.
|
|
71
|
+
- Don't truncate titles. They wrap.
|
|
72
|
+
|
|
73
|
+
## Accessibility
|
|
74
|
+
|
|
75
|
+
- `<nav>` with a specific `aria-label` ("Post navigation", "Writing pages").
|
|
76
|
+
- Disabled ends are not links, so they're skipped by Tab.
|
|
77
|
+
- Cells are at least 44px tall.
|
|
78
|
+
- Pairs: `color.text.primary` titles on `color.surface.raised` and `color.surface.hover` (7:1); `color.text.muted` labels (4.5:1).
|