@aitrien/motifspec 1.13.0 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +269 -257
  2. package/LICENSE +21 -21
  3. package/README.md +150 -150
  4. package/dist/backdrop.html +1 -1
  5. package/dist/chroma.css +36 -36
  6. package/dist/codex.css +1145 -1145
  7. package/dist/codex.js +126 -126
  8. package/dist/contrast.md +101 -101
  9. package/dist/fonts.css +3 -3
  10. package/dist/icons.svg +18 -18
  11. package/dist/plate.html +1 -1
  12. package/dist/plate.js +292 -292
  13. package/dist/theme-init.js +1 -1
  14. package/dist/tokens.css +466 -466
  15. package/dist/tokens.js +3330 -3330
  16. package/dist/tokens.json +3330 -3330
  17. package/docs/components/_template.md +37 -37
  18. package/docs/components/accession-label.md +106 -106
  19. package/docs/components/backdrop.md +83 -83
  20. package/docs/components/button-and-link.md +87 -87
  21. package/docs/components/callout.md +75 -75
  22. package/docs/components/code-block.md +109 -109
  23. package/docs/components/data-table.md +73 -73
  24. package/docs/components/figure.md +68 -68
  25. package/docs/components/heading-anchor.md +76 -76
  26. package/docs/components/icon.md +63 -63
  27. package/docs/components/ornament.md +77 -77
  28. package/docs/components/pagination.md +78 -78
  29. package/docs/components/post-list-item.md +91 -91
  30. package/docs/components/project-card.md +82 -82
  31. package/docs/components/prose.md +122 -122
  32. package/docs/components/site-footer.md +99 -99
  33. package/docs/components/site-header.md +133 -133
  34. package/docs/components/specimen-plate.md +92 -92
  35. package/docs/components/table-of-contents.md +83 -83
  36. package/docs/components/tag.md +70 -70
  37. package/docs/components/tooltip.md +67 -67
  38. package/docs/hugo.md +120 -120
  39. package/docs/syntax-highlighting.md +55 -55
  40. package/docs/templates.md +30 -30
  41. package/fonts/OFL-jetbrains-mono.txt +93 -93
  42. package/fonts/OFL-national-park.txt +93 -93
  43. package/fonts/OFL-yarndings-12.txt +93 -93
  44. package/icons/LICENSE +202 -202
  45. package/icons/manifest.json +75 -75
  46. package/layouts/_markup/render-blockquote.html +30 -30
  47. package/layouts/_markup/render-codeblock.html +18 -18
  48. package/layouts/_markup/render-heading.html +2 -2
  49. package/layouts/_markup/render-image.html +14 -14
  50. package/layouts/_markup/render-link.html +14 -14
  51. package/layouts/_markup/render-table.html +31 -31
  52. package/layouts/_partials/motifspec/accession/id.html +2 -2
  53. package/layouts/_partials/motifspec/accession/label.html +18 -18
  54. package/layouts/_partials/motifspec/accession/status.html +2 -2
  55. package/layouts/_partials/motifspec/article.html +24 -24
  56. package/layouts/_partials/motifspec/back-link.html +2 -2
  57. package/layouts/_partials/motifspec/body-end.html +5 -5
  58. package/layouts/_partials/motifspec/body-start.html +5 -5
  59. package/layouts/_partials/motifspec/figure.html +14 -14
  60. package/layouts/_partials/motifspec/filed-under.html +5 -5
  61. package/layouts/_partials/motifspec/h2s.html +7 -7
  62. package/layouts/_partials/motifspec/head.html +15 -15
  63. package/layouts/_partials/motifspec/pagination-entries.html +34 -34
  64. package/layouts/_partials/motifspec/pagination-pages.html +30 -30
  65. package/layouts/_partials/motifspec/post-list-item.html +15 -15
  66. package/layouts/_partials/motifspec/project-card.html +23 -23
  67. package/layouts/_partials/motifspec/section-heading.html +3 -3
  68. package/layouts/_partials/motifspec/site-header.html +27 -27
  69. package/layouts/_partials/motifspec/table-of-contents.html +21 -21
  70. package/layouts/_partials/motifspec/tag-filter.html +22 -22
  71. package/layouts/_partials/motifspec/tags.html +8 -8
  72. package/layouts/_partials/motifspec/tokens.html +9 -9
  73. package/package.json +68 -68
  74. package/scripts/check.mjs +153 -153
  75. package/scripts/lib.mjs +176 -176
  76. package/tokens/README.md +3 -3
  77. package/tokens/border.json +63 -63
  78. package/tokens/color.json +1902 -1902
  79. package/tokens/motion.json +207 -207
  80. package/tokens/radius.json +53 -53
  81. package/tokens/size.json +378 -378
  82. package/tokens/space.json +289 -289
  83. package/tokens/typography.json +859 -859
@@ -1,75 +1,75 @@
1
- ---
2
- name: callout
3
- status: stable
4
- tokens:
5
- - border.width.emphasis
6
- - border.width.hairline
7
- - color.status.danger.border
8
- - color.status.danger.surface
9
- - color.status.danger.text
10
- - color.status.info.border
11
- - color.status.info.surface
12
- - color.status.info.text
13
- - color.status.success.border
14
- - color.status.success.surface
15
- - color.status.success.text
16
- - color.status.warning.border
17
- - color.status.warning.surface
18
- - color.status.warning.text
19
- - color.text.primary
20
- - font.family.mono
21
- - font.line-height.ui
22
- - font.size.label
23
- - font.tracking.label
24
- - font.weight.ui
25
- - size.measure.prose
26
- - space.inline.sm
27
- - space.inset.md
28
- - space.stack.lg
29
- - space.stack.sm
30
- ---
31
-
32
- # Callout
33
-
34
- A tinted note set apart from running text, in four kinds: note, tip, warning and danger.
35
-
36
- ## When to use
37
-
38
- - For information the reader must not miss: a breaking change, a prerequisite, a safety warning.
39
- - For a short aside that would interrupt the paragraph (note) or a shortcut (tip).
40
-
41
- ## When not to use
42
-
43
- - More than twice per article. Callouts lose force when repeated.
44
- - For quotations; use `<blockquote>`.
45
- - For decoration or to make a paragraph "pop".
46
-
47
- ## Markup
48
-
49
- Hugo shortcode output (`{{< callout warning >}}…{{< /callout >}}`):
50
-
51
- ```html preview
52
- <div class="cx-callout cx-callout--warning" role="note">
53
- <p class="cx-callout__title"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-warning"></use></svg>Warning</p>
54
- <p>Renaming a semantic token is a major version bump.</p>
55
- </div>
56
- ```
57
-
58
- Kinds and their icons: no modifier with `note` (info hues), `--tip` with `tip`, `--warning` with `warning`, `--danger` with `danger`.
59
-
60
- ## Do
61
-
62
- - Always include the title text; it names the kind. The icon is a second cue.
63
- - Keep the body to one or two sentences.
64
- - Use the kind that matches the consequence: danger only for data loss, breakage or security.
65
-
66
- ## Don't
67
-
68
- - Don't use the icon in place of the title, or ornaments anywhere in a callout.
69
- - Don't nest callouts or put code blocks inside them.
70
-
71
- ## Accessibility
72
-
73
- - `role="note"` exposes the callout without adding a landmark.
74
- - The kind is in text, so colour is a second signal.
75
- - Pairs: `color.status.*.text` on `color.status.*.surface` (4.5:1); `color.text.primary` body on each status surface (7:1); `color.status.*.border` (3:1).
1
+ ---
2
+ name: callout
3
+ status: stable
4
+ tokens:
5
+ - border.width.emphasis
6
+ - border.width.hairline
7
+ - color.status.danger.border
8
+ - color.status.danger.surface
9
+ - color.status.danger.text
10
+ - color.status.info.border
11
+ - color.status.info.surface
12
+ - color.status.info.text
13
+ - color.status.success.border
14
+ - color.status.success.surface
15
+ - color.status.success.text
16
+ - color.status.warning.border
17
+ - color.status.warning.surface
18
+ - color.status.warning.text
19
+ - color.text.primary
20
+ - font.family.mono
21
+ - font.line-height.ui
22
+ - font.size.label
23
+ - font.tracking.label
24
+ - font.weight.ui
25
+ - size.measure.prose
26
+ - space.inline.sm
27
+ - space.inset.md
28
+ - space.stack.lg
29
+ - space.stack.sm
30
+ ---
31
+
32
+ # Callout
33
+
34
+ A tinted note set apart from running text, in four kinds: note, tip, warning and danger.
35
+
36
+ ## When to use
37
+
38
+ - For information the reader must not miss: a breaking change, a prerequisite, a safety warning.
39
+ - For a short aside that would interrupt the paragraph (note) or a shortcut (tip).
40
+
41
+ ## When not to use
42
+
43
+ - More than twice per article. Callouts lose force when repeated.
44
+ - For quotations; use `<blockquote>`.
45
+ - For decoration or to make a paragraph "pop".
46
+
47
+ ## Markup
48
+
49
+ Hugo shortcode output (`{{< callout warning >}}…{{< /callout >}}`):
50
+
51
+ ```html preview
52
+ <div class="cx-callout cx-callout--warning" role="note">
53
+ <p class="cx-callout__title"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-warning"></use></svg>Warning</p>
54
+ <p>Renaming a semantic token is a major version bump.</p>
55
+ </div>
56
+ ```
57
+
58
+ Kinds and their icons: no modifier with `note` (info hues), `--tip` with `tip`, `--warning` with `warning`, `--danger` with `danger`.
59
+
60
+ ## Do
61
+
62
+ - Always include the title text; it names the kind. The icon is a second cue.
63
+ - Keep the body to one or two sentences.
64
+ - Use the kind that matches the consequence: danger only for data loss, breakage or security.
65
+
66
+ ## Don't
67
+
68
+ - Don't use the icon in place of the title, or ornaments anywhere in a callout.
69
+ - Don't nest callouts or put code blocks inside them.
70
+
71
+ ## Accessibility
72
+
73
+ - `role="note"` exposes the callout without adding a landmark.
74
+ - The kind is in text, so colour is a second signal.
75
+ - Pairs: `color.status.*.text` on `color.status.*.surface` (4.5:1); `color.text.primary` body on each status surface (7:1); `color.status.*.border` (3:1).
@@ -1,109 +1,109 @@
1
- ---
2
- name: code-block
3
- status: stable
4
- tokens:
5
- - border.focus.offset
6
- - border.focus.width
7
- - border.width.emphasis
8
- - border.width.hairline
9
- - color.accent.border
10
- - color.border.default
11
- - color.border.strong
12
- - color.border.subtle
13
- - color.focus.ring
14
- - color.status.success.border
15
- - color.status.success.text
16
- - color.surface.raised
17
- - color.surface.sunken
18
- - color.syntax.attribute
19
- - color.syntax.comment
20
- - color.syntax.deleted
21
- - color.syntax.function
22
- - color.syntax.heading
23
- - color.syntax.inserted
24
- - color.syntax.keyword
25
- - color.syntax.line-highlight
26
- - color.syntax.line-number
27
- - color.syntax.meta
28
- - color.syntax.number
29
- - color.syntax.operator
30
- - color.syntax.string
31
- - color.syntax.tag
32
- - color.syntax.type
33
- - color.syntax.variable
34
- - color.text.muted
35
- - color.text.primary
36
- - color.text.secondary
37
- - font.family.mono
38
- - font.line-height.code
39
- - font.line-height.ui
40
- - font.size.label
41
- - font.size.small
42
- - font.tracking.label
43
- - font.tracking.ui
44
- - font.weight.strong
45
- - font.weight.ui
46
- - radius.pill
47
- - size.container.breakout
48
- - size.measure.prose
49
- - size.target.control
50
- - size.target.min
51
- - space.inline.lg
52
- - space.inline.md
53
- - space.inline.xs
54
- - space.inset.lg
55
- - space.inset.md
56
- - space.inset.sm
57
- - space.stack.lg
58
- ---
59
-
60
- # Code block
61
-
62
- A framed block of syntax-highlighted code with a header bar for language, file name and a copy button.
63
-
64
- ## When to use
65
-
66
- - For any code longer than one line, in posts, case studies and docs.
67
- - For terminal sessions and diffs (use Chroma's `console` and `diff` lexers).
68
-
69
- ## When not to use
70
-
71
- - For a single identifier or command inside a sentence; use inline `<code>` in `prose`.
72
- - For configuration tables; use `data-table`.
73
-
74
- ## Markup
75
-
76
- Hugo render hook (`layouts/_default/_markup/render-codeblock.html`):
77
-
78
- ```html preview
79
- <figure class="cx-code">
80
- <figcaption class="cx-code__bar">
81
- <span>ts</span>
82
- <span class="cx-code__file">src/globe/arc-layer.ts</span>
83
- <button class="cx-code__copy" type="button" hidden><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use data-copy-icon href="#cx-icon-content-copy"></use></svg><span class="cx-code__copy-label">Copy</span></button>
84
- </figcaption>
85
- <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-ts" data-lang="ts"><span class="line"><span class="cl"><span class="kd">const</span> <span class="nx">count</span> <span class="o">=</span> <span class="mi">6</span><span class="p">;</span>
86
- </span></span></code></pre></div>
87
- </figure>
88
- ```
89
-
90
- ## Do
91
-
92
- - Show the file path when the reader would open that file.
93
- - Use `hl_lines` to point at the one line the prose discusses.
94
- - Add `.cx-code--breakout` inside prose when lines exceed 66 characters; the block fits 80ch.
95
- - Keep the copy button a pill (`radius.pill`), like every button.
96
- - Reveal the copy button from script (`hidden` by default). On success the script swaps `content-copy` for `check` and the label for "Copied", then reverts after `--cx-motion-duration-plate`.
97
-
98
- ## Don't
99
-
100
- - Don't wrap long lines; the block scrolls horizontally.
101
- - Don't use a generated Chroma theme. Colours come from `color.syntax.*` (see `syntax-highlighting.md`).
102
- - Don't italicise comments.
103
-
104
- ## Accessibility
105
-
106
- - `<pre tabindex="0">` makes the scroll region keyboard-reachable.
107
- - The copy button says "Copied" on success. If the clipboard is refused, the code is selected and the button says to press Ctrl+C.
108
- - Highlighted lines use an inset rule as well as a background, so the cue survives forced colours.
109
- - Pairs: every `color.syntax.*` role on `color.surface.sunken` and `color.syntax.line-highlight` (4.5:1, both themes).
1
+ ---
2
+ name: code-block
3
+ status: stable
4
+ tokens:
5
+ - border.focus.offset
6
+ - border.focus.width
7
+ - border.width.emphasis
8
+ - border.width.hairline
9
+ - color.accent.border
10
+ - color.border.default
11
+ - color.border.strong
12
+ - color.border.subtle
13
+ - color.focus.ring
14
+ - color.status.success.border
15
+ - color.status.success.text
16
+ - color.surface.raised
17
+ - color.surface.sunken
18
+ - color.syntax.attribute
19
+ - color.syntax.comment
20
+ - color.syntax.deleted
21
+ - color.syntax.function
22
+ - color.syntax.heading
23
+ - color.syntax.inserted
24
+ - color.syntax.keyword
25
+ - color.syntax.line-highlight
26
+ - color.syntax.line-number
27
+ - color.syntax.meta
28
+ - color.syntax.number
29
+ - color.syntax.operator
30
+ - color.syntax.string
31
+ - color.syntax.tag
32
+ - color.syntax.type
33
+ - color.syntax.variable
34
+ - color.text.muted
35
+ - color.text.primary
36
+ - color.text.secondary
37
+ - font.family.mono
38
+ - font.line-height.code
39
+ - font.line-height.ui
40
+ - font.size.label
41
+ - font.size.small
42
+ - font.tracking.label
43
+ - font.tracking.ui
44
+ - font.weight.strong
45
+ - font.weight.ui
46
+ - radius.pill
47
+ - size.container.breakout
48
+ - size.measure.prose
49
+ - size.target.control
50
+ - size.target.min
51
+ - space.inline.lg
52
+ - space.inline.md
53
+ - space.inline.xs
54
+ - space.inset.lg
55
+ - space.inset.md
56
+ - space.inset.sm
57
+ - space.stack.lg
58
+ ---
59
+
60
+ # Code block
61
+
62
+ A framed block of syntax-highlighted code with a header bar for language, file name and a copy button.
63
+
64
+ ## When to use
65
+
66
+ - For any code longer than one line, in posts, case studies and docs.
67
+ - For terminal sessions and diffs (use Chroma's `console` and `diff` lexers).
68
+
69
+ ## When not to use
70
+
71
+ - For a single identifier or command inside a sentence; use inline `<code>` in `prose`.
72
+ - For configuration tables; use `data-table`.
73
+
74
+ ## Markup
75
+
76
+ Hugo render hook (`layouts/_default/_markup/render-codeblock.html`):
77
+
78
+ ```html preview
79
+ <figure class="cx-code">
80
+ <figcaption class="cx-code__bar">
81
+ <span>ts</span>
82
+ <span class="cx-code__file">src/globe/arc-layer.ts</span>
83
+ <button class="cx-code__copy" type="button" hidden><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use data-copy-icon href="#cx-icon-content-copy"></use></svg><span class="cx-code__copy-label">Copy</span></button>
84
+ </figcaption>
85
+ <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-ts" data-lang="ts"><span class="line"><span class="cl"><span class="kd">const</span> <span class="nx">count</span> <span class="o">=</span> <span class="mi">6</span><span class="p">;</span>
86
+ </span></span></code></pre></div>
87
+ </figure>
88
+ ```
89
+
90
+ ## Do
91
+
92
+ - Show the file path when the reader would open that file.
93
+ - Use `hl_lines` to point at the one line the prose discusses.
94
+ - Add `.cx-code--breakout` inside prose when lines exceed 66 characters; the block fits 80ch.
95
+ - Keep the copy button a pill (`radius.pill`), like every button.
96
+ - Reveal the copy button from script (`hidden` by default). On success the script swaps `content-copy` for `check` and the label for "Copied", then reverts after `--cx-motion-duration-plate`.
97
+
98
+ ## Don't
99
+
100
+ - Don't wrap long lines; the block scrolls horizontally.
101
+ - Don't use a generated Chroma theme. Colours come from `color.syntax.*` (see `syntax-highlighting.md`).
102
+ - Don't italicise comments.
103
+
104
+ ## Accessibility
105
+
106
+ - `<pre tabindex="0">` makes the scroll region keyboard-reachable.
107
+ - The copy button says "Copied" on success. If the clipboard is refused, the code is selected and the button says to press Ctrl+C.
108
+ - Highlighted lines use an inset rule as well as a background, so the cue survives forced colours.
109
+ - Pairs: every `color.syntax.*` role on `color.surface.sunken` and `color.syntax.line-highlight` (4.5:1, both themes).
@@ -1,73 +1,73 @@
1
- ---
2
- name: data-table
3
- status: stable
4
- tokens:
5
- - border.focus.offset
6
- - border.focus.width
7
- - border.width.hairline
8
- - color.border.default
9
- - color.border.subtle
10
- - color.focus.ring
11
- - color.surface.hover
12
- - color.surface.raised
13
- - color.surface.sunken
14
- - color.text.muted
15
- - color.text.secondary
16
- - font.family.mono
17
- - font.line-height.ui
18
- - font.size.label
19
- - font.size.small
20
- - font.tracking.label
21
- - font.weight.strong
22
- - font.weight.ui
23
- - size.container.breakout
24
- - size.measure.prose
25
- - space.inset.md
26
- - space.inset.sm
27
- - space.stack.lg
28
- ---
29
-
30
- # Data table
31
-
32
- A framed table for comparing values: mono headers, hairline rows, right-aligned figures, and horizontal scroll when needed.
33
-
34
- ## When to use
35
-
36
- - For real tabular data: metrics, version histories, font budgets, recipe quantities, API parameters.
37
- - In prose, with `cx-table--breakout` when it has more than four columns.
38
-
39
- ## When not to use
40
-
41
- - For layout.
42
- - For two-column key–value facts about an entry; use `accession-label`.
43
-
44
- ## Markup
45
-
46
- ```html preview
47
- <div class="cx-table" role="region" aria-labelledby="tbl-fonts" tabindex="0">
48
- <table>
49
- <caption id="tbl-fonts">Font budget <span class="cx-sep" aria-hidden="true">|</span> Latin subset</caption>
50
- <thead><tr><th scope="col">Family</th><th scope="col">Role</th><th scope="col" class="is-num">KB</th></tr></thead>
51
- <tbody>
52
- <tr><th scope="row">National Park</th><td>Display, body</td><td class="is-num">38.1</td></tr>
53
- </tbody>
54
- </table>
55
- </div>
56
- ```
57
-
58
- ## Do
59
-
60
- - Give every table a `<caption>`.
61
- - Mark numeric columns `is-num` (right-aligned, tabular, mono).
62
- - Use `<th scope="row">` for the first cell when it names the row.
63
-
64
- ## Don't
65
-
66
- - Don't zebra-stripe; rows are separated by hairlines and highlight on hover.
67
- - Don't put interactive controls in cells.
68
-
69
- ## Accessibility
70
-
71
- - The wrapper is a focusable region named by the caption, so keyboard users can scroll it.
72
- - Header cells use `scope`.
73
- - Pairs: `color.text.secondary` headers on `color.surface.sunken` (7:1); `color.text.primary` cells on `color.surface.raised` and `color.surface.hover` (7:1).
1
+ ---
2
+ name: data-table
3
+ status: stable
4
+ tokens:
5
+ - border.focus.offset
6
+ - border.focus.width
7
+ - border.width.hairline
8
+ - color.border.default
9
+ - color.border.subtle
10
+ - color.focus.ring
11
+ - color.surface.hover
12
+ - color.surface.raised
13
+ - color.surface.sunken
14
+ - color.text.muted
15
+ - color.text.secondary
16
+ - font.family.mono
17
+ - font.line-height.ui
18
+ - font.size.label
19
+ - font.size.small
20
+ - font.tracking.label
21
+ - font.weight.strong
22
+ - font.weight.ui
23
+ - size.container.breakout
24
+ - size.measure.prose
25
+ - space.inset.md
26
+ - space.inset.sm
27
+ - space.stack.lg
28
+ ---
29
+
30
+ # Data table
31
+
32
+ A framed table for comparing values: mono headers, hairline rows, right-aligned figures, and horizontal scroll when needed.
33
+
34
+ ## When to use
35
+
36
+ - For real tabular data: metrics, version histories, font budgets, recipe quantities, API parameters.
37
+ - In prose, with `cx-table--breakout` when it has more than four columns.
38
+
39
+ ## When not to use
40
+
41
+ - For layout.
42
+ - For two-column key–value facts about an entry; use `accession-label`.
43
+
44
+ ## Markup
45
+
46
+ ```html preview
47
+ <div class="cx-table" role="region" aria-labelledby="tbl-fonts" tabindex="0">
48
+ <table>
49
+ <caption id="tbl-fonts">Font budget <span class="cx-sep" aria-hidden="true">|</span> Latin subset</caption>
50
+ <thead><tr><th scope="col">Family</th><th scope="col">Role</th><th scope="col" class="is-num">KB</th></tr></thead>
51
+ <tbody>
52
+ <tr><th scope="row">National Park</th><td>Display, body</td><td class="is-num">38.1</td></tr>
53
+ </tbody>
54
+ </table>
55
+ </div>
56
+ ```
57
+
58
+ ## Do
59
+
60
+ - Give every table a `<caption>`.
61
+ - Mark numeric columns `is-num` (right-aligned, tabular, mono).
62
+ - Use `<th scope="row">` for the first cell when it names the row.
63
+
64
+ ## Don't
65
+
66
+ - Don't zebra-stripe; rows are separated by hairlines and highlight on hover.
67
+ - Don't put interactive controls in cells.
68
+
69
+ ## Accessibility
70
+
71
+ - The wrapper is a focusable region named by the caption, so keyboard users can scroll it.
72
+ - Header cells use `scope`.
73
+ - Pairs: `color.text.secondary` headers on `color.surface.sunken` (7:1); `color.text.primary` cells on `color.surface.raised` and `color.surface.hover` (7:1).
@@ -1,68 +1,68 @@
1
- ---
2
- name: figure
3
- status: stable
4
- tokens:
5
- - border.width.hairline
6
- - color.border.default
7
- - color.surface.raised
8
- - color.text.accent
9
- - color.text.secondary
10
- - font.family.mono
11
- - font.line-height.ui
12
- - font.size.label
13
- - font.size.small
14
- - font.tracking.label
15
- - font.weight.ui
16
- - size.column.card
17
- - size.container.breakout
18
- - size.measure.caption
19
- - size.measure.prose
20
- - space.inline.md
21
- - space.stack.lg
22
- - space.stack.sm
23
- - space.stack.xs
24
- ---
25
-
26
- # Figure and caption
27
-
28
- A framed image or diagram with a numbered plate label and a caption.
29
-
30
- ## When to use
31
-
32
- - For screenshots, diagrams and charts in posts and case studies.
33
- - For the hero image of a case study ("Plate 1").
34
-
35
- ## When not to use
36
-
37
- - For decorative images; omit them.
38
- - For code; use `code-block`. For tabular data; use `data-table`.
39
-
40
- ## Markup
41
-
42
- ```html preview
43
- <figure class="cx-figure cx-figure--breakout cx-figure--diagram">
44
- <div class="cx-figure__frame">
45
- <svg viewBox="0 0 720 200" role="img" aria-labelledby="fig-pipeline"><title id="fig-pipeline">Tokens flow from JSON through the validator to CSS and the MCP server</title><!-- … --></svg>
46
- </div>
47
- <figcaption><span class="cx-figure__plate">Plate 2</span>One build feeds both consumers.</figcaption>
48
- </figure>
49
- ```
50
-
51
- ## Do
52
-
53
- - Number plates in order of appearance on the page, starting at 1. Plate 0 is reserved for the specimen plate.
54
- - Write captions that say what to notice, not what the image is.
55
- - Use `cx-figure--diagram` for SVG with text, so it scrolls instead of shrinking text below 12px on phones.
56
- - Colour SVG through classes that use `color.*` tokens, never `fill="#…"`; diagrams then follow the theme.
57
- - Use `color.data.1` to `color.data.5` in order for chart series, and label series directly.
58
-
59
- ## Don't
60
-
61
- - Don't put text inside raster images.
62
- - Don't stretch figures wider than `size.container.breakout`.
63
-
64
- ## Accessibility
65
-
66
- - Informative images need `alt`, or `role="img"` with a `<title>` for SVG. The caption doesn't replace alt text.
67
- - The plate number is plain text inside `<figcaption>`.
68
- - Pairs: `color.text.secondary` caption on `color.surface.base` (7:1); `color.text.accent` plate label (4.5:1); data series on `color.surface.raised` (3:1).
1
+ ---
2
+ name: figure
3
+ status: stable
4
+ tokens:
5
+ - border.width.hairline
6
+ - color.border.default
7
+ - color.surface.raised
8
+ - color.text.accent
9
+ - color.text.secondary
10
+ - font.family.mono
11
+ - font.line-height.ui
12
+ - font.size.label
13
+ - font.size.small
14
+ - font.tracking.label
15
+ - font.weight.ui
16
+ - size.column.card
17
+ - size.container.breakout
18
+ - size.measure.caption
19
+ - size.measure.prose
20
+ - space.inline.md
21
+ - space.stack.lg
22
+ - space.stack.sm
23
+ - space.stack.xs
24
+ ---
25
+
26
+ # Figure and caption
27
+
28
+ A framed image or diagram with a numbered plate label and a caption.
29
+
30
+ ## When to use
31
+
32
+ - For screenshots, diagrams and charts in posts and case studies.
33
+ - For the hero image of a case study ("Plate 1").
34
+
35
+ ## When not to use
36
+
37
+ - For decorative images; omit them.
38
+ - For code; use `code-block`. For tabular data; use `data-table`.
39
+
40
+ ## Markup
41
+
42
+ ```html preview
43
+ <figure class="cx-figure cx-figure--breakout cx-figure--diagram">
44
+ <div class="cx-figure__frame">
45
+ <svg viewBox="0 0 720 200" role="img" aria-labelledby="fig-pipeline"><title id="fig-pipeline">Tokens flow from JSON through the validator to CSS and the MCP server</title><!-- … --></svg>
46
+ </div>
47
+ <figcaption><span class="cx-figure__plate">Plate 2</span>One build feeds both consumers.</figcaption>
48
+ </figure>
49
+ ```
50
+
51
+ ## Do
52
+
53
+ - Number plates in order of appearance on the page, starting at 1. Plate 0 is reserved for the specimen plate.
54
+ - Write captions that say what to notice, not what the image is.
55
+ - Use `cx-figure--diagram` for SVG with text, so it scrolls instead of shrinking text below 12px on phones.
56
+ - Colour SVG through classes that use `color.*` tokens, never `fill="#…"`; diagrams then follow the theme.
57
+ - Use `color.data.1` to `color.data.5` in order for chart series, and label series directly.
58
+
59
+ ## Don't
60
+
61
+ - Don't put text inside raster images.
62
+ - Don't stretch figures wider than `size.container.breakout`.
63
+
64
+ ## Accessibility
65
+
66
+ - Informative images need `alt`, or `role="img"` with a `<title>` for SVG. The caption doesn't replace alt text.
67
+ - The plate number is plain text inside `<figcaption>`.
68
+ - Pairs: `color.text.secondary` caption on `color.surface.base` (7:1); `color.text.accent` plate label (4.5:1); data series on `color.surface.raised` (3:1).