@aitrien/motifspec 1.20.0 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  Every release of MotifSpec (named brand-codex until 1.10.0), newest first. Entries before 1.10.0 keep the names they were released under. Versions follow the rules in `CONVENTIONS.md`: renaming or removing a semantic token is major, adding tokens, components or icons is minor, and changing a value or fixing a description is a patch. `npm run build` fails if the version in `package.json` has no entry here.
4
4
 
5
+ ## [1.21.0] - 2026-11-05
6
+
7
+ ### Added
8
+ - `specimen-plate.html`: a Hugo partial that frames any illustration as a specimen plate, with its pause control and "Plate 0" caption. It inlines an `.svg` or `.html` asset (`motifspec/plate.html` is the contour survey) or plays an `.mp4` or `.webm` video, takes a text alternative (`label`) for an illustration a reader needs, a `poster` for a video, and `wide` for a 16:10 plate (`cx-plate--wide`).
9
+ - `dist/codex.js` runs the pause control for any plate marked `data-plate-motion`: it reveals the control, pauses or plays CSS animations and SMIL in an inline SVG and video with it, sets `data-paused` on the frame, and sends a `cx-plate-pause` event for a scripted drawing. Under reduced motion nothing plays and the control stays hidden.
10
+
11
+ ### Changed
12
+ - The specimen plate is now a frame for any moving illustration (an animated SVG, a short silent video or a scripted drawing), in a page's head beside or below the statement, with the contour survey as the one MotifSpec ships. It belongs to every layout (`layouts: [shared]`), not only the portfolio. Its drawing classes (`cx-plate__grid`, `cx-plate__line`, `cx-plate__line--index`) suit any line drawing.
13
+
14
+ ### Fixed
15
+ - The specimen plate's and backdrop's examples on motifspec.com showed Hugo template code (`{{ (resources.Get "motifspec/plate.html").Content | safeHTML }}`) in their live previews. The plate's example is now HTML, the backdrop's is fenced as a Hugo template without a preview, and the code block hook fails the build on a previewed example with template syntax.
16
+
17
+ ## [1.20.1] - 2026-11-05
18
+
19
+ ### Changed
20
+ - The page footer links to a page's source with **View source**, given `params.motifspec.sourceURL` (the repository's address for viewing files). `editURL` still gives Edit this page. A page made from one section of a file opens at that heading (its `sourceAnchor` param), where an editor would open at the top of the file. A page's `data` param, the files its generated tables come from, shows as "Generated from" after the date, and `page-footer.md` lists the params.
21
+ - motifspec.com's pages about the tokens, icons and checker rules keep their wording in Markdown in `docs/foundations/` and `docs/reference/`, with a visible line such as "*Generated from `tokens/color.json`: the palette.*" where each table goes. View source opens that file, and the footer names the data. The build fails if a line names the wrong files or an element no page shows.
22
+
23
+ ### Fixed
24
+ - motifspec.com's Type page showed "[object Object]" after the weight, leading and tracking table, from a misplaced bracket in the generator, and that table didn't widen like the others.
25
+ - On motifspec.com, Edit this page opened the whole README for pages made from one of its sections, and a data file for pages whose wording was in the generator. View source now opens the section, or the file with all of the page's wording.
26
+
5
27
  ## [1.20.0] - 2026-11-05
6
28
 
7
29
  ### Added
package/README.md CHANGED
@@ -160,6 +160,7 @@ icons/ Approved Material Symbols (manifest.json, source SVGs, Apach
160
160
  docs/components/ One rule file per component (front-matter token lists generated from the CSS)
161
161
  docs/layouts/ One file per layout: shell, page templates, components, decoration, headings, stack
162
162
  docs/hugo.md The Hugo partials and render hooks, their contexts and the front matter they read
163
+ docs/foundations/, docs/reference/ The wording of motifspec.com's pages about the tokens, icons and checker rules; their tables are generated
163
164
  layouts/ Hugo partials (_partials/motifspec/) and Markdown render hooks (_markup/), mounted by the module
164
165
  docs/syntax-highlighting.md
165
166
  fonts/ Self-hosted WOFF2 (Latin subsets) and their OFL licences
package/dist/codex.css CHANGED
@@ -2,7 +2,7 @@
2
2
  @font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
3
3
  @font-face { font-family: "Yarndings 12"; src: url("../fonts/yarndings-12-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
4
4
 
5
- /* MotifSpec 1.20.0 — generated from tokens/*.json. Do not edit.
5
+ /* MotifSpec 1.21.0 — generated from tokens/*.json. Do not edit.
6
6
  Themes: semantic colours use light-dark(); color-scheme follows the system unless
7
7
  <html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
8
8
  :root {
@@ -608,6 +608,9 @@ p, li, dd, figcaption { text-wrap: pretty; }
608
608
  border-top: var(--cx-border-width-hairline) solid var(--cx-color-border-subtle);
609
609
  }
610
610
  .cx-page-footer .cx-meta { margin: 0; }
611
+ /* The files a page's generated tables come from: inline links, as in prose. */
612
+ .cx-page-footer .cx-meta a { color: var(--cx-color-link-rest); text-decoration-thickness: var(--cx-border-width-hairline); text-underline-offset: var(--cx-space-inline-xs); }
613
+ .cx-page-footer .cx-meta a:hover { color: var(--cx-color-link-hover); text-decoration-thickness: var(--cx-border-width-emphasis); }
611
614
 
612
615
  /* ------------------------------------------------------------ search (a dialog over the page, from the header) */
613
616
  .cx-search-trigger {
@@ -1236,13 +1239,24 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
1236
1239
  .cx-toc a[aria-current="true"] { color: var(--cx-color-text-primary); border-left-color: var(--cx-color-accent-border); }
1237
1240
  .cx-toc__no { color: var(--cx-color-text-muted); font-family: var(--cx-font-family-mono); font-size: var(--cx-font-size-label); font-variant-numeric: tabular-nums; }
1238
1241
 
1239
- /* ------------------------------------------------------------ specimen plate (contour survey of simplex-noise terrain) */
1242
+ /* ------------------------------------------------------------ specimen plate (specimen-plate.md) */
1243
+ /* A framed, captioned illustration that moves: an inline SVG, a video, a scripted drawing, or MotifSpec's own contour
1244
+ survey of simplex-noise terrain (data-plate-seed, run by js/plate.js). */
1240
1245
  .cx-plate-frame { position: relative; display: inline-flex; flex-direction: column; gap: var(--cx-space-stack-sm); margin: var(--cx-size-mark-tick); padding: var(--cx-space-inset-md); border: var(--cx-border-width-hairline) solid var(--cx-color-border-default); background: var(--cx-color-surface-raised); max-width: 100%; }
1241
1246
  .cx-plate {
1242
1247
  position: relative; width: var(--cx-size-column-card); max-width: 100%; aspect-ratio: 1; overflow: hidden;
1243
1248
  /* Read by js/plate.js: how long the terrain takes to drift one noise unit, and how long to wait for the draw-in. */
1244
1249
  --cx-plate-drift: var(--cx-motion-duration-drift); --cx-plate-draw: var(--cx-motion-duration-plate);
1245
1250
  }
1251
+ .cx-plate--wide { width: calc(var(--cx-size-column-card) * 1.6); aspect-ratio: 16 / 10; }
1252
+ /* Whatever the illustration is, it fills the plate. */
1253
+ .cx-plate > :is(svg, img, video, canvas) { display: block; width: 100%; height: 100%; object-fit: cover; }
1254
+ /* Paused (dist/codex.js sets data-paused on the frame), CSS animations in the illustration stop where they are. Under
1255
+ reduced motion they never run: an illustration must read complete without them. */
1256
+ .cx-plate-frame[data-paused] .cx-plate[data-plate-motion] :is(*, *::before, *::after) { animation-play-state: paused !important; }
1257
+ @media (prefers-reduced-motion: reduce) {
1258
+ .cx-plate[data-plate-motion] :is(*, *::before, *::after) { animation: none !important; transition: none !important; }
1259
+ }
1246
1260
  .cx-plate__map { display: block; width: 100%; height: 100%; }
1247
1261
  .cx-plate__map path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
1248
1262
  .cx-plate__grid { stroke: var(--cx-color-ornament-muted); stroke-width: var(--cx-border-width-hairline); }
@@ -1258,8 +1272,9 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
1258
1272
  /* The dash only exists for the draw-in. The last keyframe drops it, so lines reshaped later never show gaps. */
1259
1273
  @keyframes cx-contour { 99% { stroke-dasharray: 1; stroke-dashoffset: 0; } 100% { stroke-dasharray: none; stroke-dashoffset: 0; } }
1260
1274
 
1261
- /* Pause control: a native checkbox styled as an icon-only pill. It ships hidden; the script reveals it when it
1262
- starts the drift, so it never appears on a plate that isn't moving. */
1275
+ /* Pause control: a native checkbox styled as an icon-only pill. It ships hidden; a script reveals it when the
1276
+ illustration starts moving (js/plate.js for the contour survey, dist/codex.js for any other), so it never appears
1277
+ on a plate that isn't moving. */
1263
1278
  .cx-plate__pause {
1264
1279
  position: absolute; z-index: 2; top: var(--cx-space-inset-sm); right: var(--cx-space-inset-sm);
1265
1280
  display: inline-grid; place-items: center; width: var(--cx-size-target-touch); height: var(--cx-size-target-touch);
package/dist/codex.js CHANGED
@@ -297,5 +297,26 @@
297
297
  }, { rootMargin: '0px 0px -70% 0px' });
298
298
  links.forEach(function (a) { var t = document.getElementById(a.getAttribute('href').slice(1)); if (t) io.observe(t); });
299
299
  });
300
+
301
+ // Specimen plates whose illustration moves (data-plate-motion): show the pause control, and pause or play what
302
+ // is inside with it: CSS animations (through data-paused on the frame), SMIL in an inline SVG, and video. A
303
+ // scripted drawing listens for the "cx-plate-pause" event. Under reduced motion nothing plays and the control
304
+ // stays hidden. The contour survey (data-plate-seed) is run by dist/plate.js instead.
305
+ var still = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
306
+ document.querySelectorAll('.cx-plate[data-plate-motion]').forEach(function (plate) {
307
+ var frame = plate.closest('.cx-plate-frame') || plate.parentElement;
308
+ var toggle = frame.querySelector('.cx-plate__pause');
309
+ var input = toggle && toggle.querySelector('input');
310
+ var set = function (paused) {
311
+ frame.toggleAttribute('data-paused', paused);
312
+ plate.querySelectorAll('svg').forEach(function (svg) { if (svg.pauseAnimations) { if (paused) svg.pauseAnimations(); else svg.unpauseAnimations(); } });
313
+ plate.querySelectorAll('video').forEach(function (v) { if (paused) v.pause(); else { var p = v.play(); if (p && p.catch) p.catch(function () { /* autoplay refused: the poster stays */ }); } });
314
+ frame.dispatchEvent(new CustomEvent('cx-plate-pause', { bubbles: true, detail: { paused: paused } }));
315
+ };
316
+ if (still) { set(true); return; }
317
+ if (toggle) toggle.hidden = false;
318
+ if (input) input.addEventListener('change', function () { set(input.checked); });
319
+ set(Boolean(input && input.checked));
320
+ });
300
321
  });
301
322
  })();
package/dist/tokens.css CHANGED
@@ -1,4 +1,4 @@
1
- /* MotifSpec 1.20.0 — generated from tokens/*.json. Do not edit.
1
+ /* MotifSpec 1.21.0 — generated from tokens/*.json. Do not edit.
2
2
  Themes: semantic colours use light-dark(); color-scheme follows the system unless
3
3
  <html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
4
4
  :root {
package/dist/tokens.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Generated by npm run build. Do not edit.
2
- export const version = "1.20.0";
2
+ export const version = "1.21.0";
3
3
  export const changelog = "https://github.com/Aitrien/motifspec/blob/main/CHANGELOG.md";
4
4
  export const showcase = "https://motifspec.com";
5
5
  export const tokens = [
package/dist/tokens.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.20.0",
2
+ "version": "1.21.0",
3
3
  "changelog": "https://github.com/Aitrien/motifspec/blob/main/CHANGELOG.md",
4
4
  "showcase": "https://motifspec.com",
5
5
  "tokens": [
@@ -40,9 +40,22 @@ Contour surveys drawn full-bleed behind the top of the home page and the bottom
40
40
 
41
41
  ## Markup
42
42
 
43
- The build writes the head to `dist/backdrop.html` and the foot to `dist/backdrop-foot.html`: the contours at time zero, on a different stretch of terrain each, sliced to cover the layer. In Hugo, `motifspec/body-start.html` inlines the head on the home page, and `motifspec/body-end.html` inlines the foot and loads `dist/plate.js`:
43
+ The page, as it reaches the browser. Each layer's contours are an SVG the build draws (left out here, so the preview shows only the frost):
44
44
 
45
45
  ```html {preview=true}
46
+ <body class="cx-backdrop-page">
47
+ <div class="cx-backdrop cx-backdrop--head" aria-hidden="true" data-plate-seed="3" data-plate-cells="48"><!-- the contours: dist/backdrop.html --></div>
48
+ <a class="cx-skip-link" href="#main">Skip to content</a>
49
+ <header class="cx-header"><!-- site-header.md --></header>
50
+ <main id="main"><!-- the template --></main>
51
+ <footer class="cx-footer"><!-- site-footer.md --></footer>
52
+ <div class="cx-backdrop cx-backdrop--foot" aria-hidden="true" data-plate-seed="7" data-plate-cells="48"><!-- the contours: dist/backdrop-foot.html --></div>
53
+ </body>
54
+ ```
55
+
56
+ The build writes the head to `dist/backdrop.html` and the foot to `dist/backdrop-foot.html`: the contours at time zero, on a different stretch of terrain each, sliced to cover the layer. In Hugo, `motifspec/body-start.html` inlines the head on the home page, and `motifspec/body-end.html` inlines the foot and loads `dist/plate.js`:
57
+
58
+ ```go-html-template
46
59
  <body class="cx-backdrop-page">
47
60
  {{ (resources.Get "motifspec/backdrop.html").Content | safeHTML }}
48
61
  <!-- home page only: <div class="cx-backdrop cx-backdrop--head" aria-hidden="true" data-plate-seed="3" data-plate-cells="48"><svg class="cx-plate__map" preserveAspectRatio="xMidYMid slice" …>…</svg></div> -->
@@ -50,6 +50,7 @@ The frame's document has the theme snippet (`dist/theme-init.js`), `codex.css`,
50
50
  - Don't put a preview's markup straight into the page; a header or shell example would clash with the page's own.
51
51
  - Don't rely on links in an example; they don't navigate.
52
52
  - Don't preview examples that need data from the page around them.
53
+ - Don't preview an example written in Hugo template syntax (`{{ … }}`); it would show the template, not what it writes. Fence it as `go-html-template`. The code block hook fails the build on one.
53
54
 
54
55
  ## Accessibility
55
56
 
@@ -3,9 +3,13 @@ name: page-footer
3
3
  status: stable
4
4
  layouts: [documentation]
5
5
  tokens:
6
+ - border.width.emphasis
6
7
  - border.width.hairline
7
8
  - color.border.subtle
9
+ - color.link.hover
10
+ - color.link.rest
8
11
  - space.inline.lg
12
+ - space.inline.xs
9
13
  - space.section.sm
10
14
  - space.stack.lg
11
15
  - space.stack.md
@@ -14,7 +18,7 @@ tokens:
14
18
 
15
19
  # Page footer
16
20
 
17
- After a documentation page's article: when the page last changed and a link to edit its source, then previous and next in the order of the navigation.
21
+ After a documentation page's article: when the page last changed, what any generated tables come from, and a link to its source, then previous and next in the order of the navigation.
18
22
 
19
23
  ## When to use
20
24
 
@@ -30,8 +34,8 @@ After a documentation page's article: when the page last changed and a link to e
30
34
 
31
35
  ```html {preview=true}
32
36
  <footer class="cx-page-footer">
33
- <p class="cx-meta">Last updated <time datetime="2026-11-04">4 November 2026</time></p>
34
- <a class="cx-link" href="https://github.com/owner/repo/edit/main/docs/guide/getting-started.md"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-edit"></use></svg>Edit this page<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-outward"></use></svg></a>
37
+ <p class="cx-meta">Last updated <time datetime="2026-11-04">4 November 2026</time> <span class="cx-sep" aria-hidden="true">|</span> <span>Generated from <a href="https://github.com/owner/repo/blob/main/tokens/color.json">tokens/color.json</a></span></p>
38
+ <a class="cx-link" href="https://github.com/owner/repo/blob/main/docs/foundations/colour.md">View source<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-outward"></use></svg></a>
35
39
  </footer>
36
40
  <nav class="cx-pagination" aria-label="Documentation pages">
37
41
  <a class="cx-pagination__link" href="/guide/" rel="prev">
@@ -46,12 +50,26 @@ After a documentation page's article: when the page last changed and a link to e
46
50
  </nav>
47
51
  ```
48
52
 
49
- In Hugo, `partial "motifspec/page-footer.html" .` writes the footer (a page made by a content adapter from another file names that file's repository path as its `source` param, for the edit link) and `partial "motifspec/pagination-docs.html" .` the previous and next links, in the order `docs-nav.html` lists the pages (`docs/hugo.md`).
53
+ The link is **View source**, to the file on the repository's site, with `params.motifspec.sourceURL` (such as `https://github.com/owner/repo/blob/main/`). A site that would rather send readers straight to an editor sets `params.motifspec.editURL` instead, and the link is **Edit this page**, with the edit icon.
54
+
55
+ In Hugo, `partial "motifspec/page-footer.html" .` writes the footer and `partial "motifspec/pagination-docs.html" .` the previous and next links, in the order `docs-nav.html` lists the pages (`docs/hugo.md`).
56
+
57
+ ### Pages made from other files
58
+
59
+ A page with no file of its own, such as one a content adapter makes from another file, sets these params:
60
+
61
+ <!-- caption: Page footer params -->
62
+ | Param | Is | Example |
63
+ |---|---|---|
64
+ | `source` | The repository path of the file the page is made from | `README.md` |
65
+ | `sourceAnchor` | The heading the page starts at, when it is one section of the file (View source only) | `getting-started` |
66
+ | `data` | The files its generated tables come from, shown as "Generated from" | `["tokens/color.json"]` |
50
67
 
51
68
  ## Do
52
69
 
53
70
  - Show the date the content last changed, from version control where possible, written as a reader would say it ("4 November 2026").
54
- - Link "Edit this page" to the page's source file, not to a generated copy.
71
+ - Link to the page's source file, not to a generated copy. A page made from one section of a file opens at that section (`sourceAnchor`, below); a file in an editor can't, so prefer View source for a site with such pages.
72
+ - Name the files a page's generated tables come from, after the date, so a reader knows where to change a value.
55
73
  - Name the group in the pagination's middle cell, with the page's position in the whole set.
56
74
 
57
75
  ## Don't
@@ -62,6 +80,7 @@ In Hugo, `partial "motifspec/page-footer.html" .` writes the footer (a page made
62
80
  ## Accessibility
63
81
 
64
82
  - The date is a `<time>` with a machine-readable `datetime`.
65
- - The edit link's text says what it does; both icons are `aria-hidden`, and the outward arrow repeats that it leaves the site.
83
+ - The link's text says what it does (View source, or Edit this page); its icons are `aria-hidden`, and the outward arrow repeats that it leaves the site.
66
84
  - The pagination is a `<nav>` named "Documentation pages", separate from the navigation's "Documentation". Pairs and targets as `pagination.md`.
85
+ - The generated-from links are underlined, like links in prose, so they read as links in the mono line without relying on colour.
67
86
  - Pairs: `color.text.muted` on `color.surface.base` (4.5:1) for the date; `color.link.rest` on `color.surface.base` (7:1).
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specimen-plate
3
3
  status: stable
4
- layouts: [portfolio]
4
+ layouts: [shared]
5
5
  tokens:
6
6
  - border.focus.offset
7
7
  - border.focus.width
@@ -38,24 +38,25 @@ tokens:
38
38
 
39
39
  # Specimen plate
40
40
 
41
- A contour survey of generated terrain: simplex-noise height lines drawn as a static SVG, which slowly reshape as the terrain drifts. Framed with registration ticks and captioned as Plate 0.
41
+ A framed, captioned illustration that moves: an animated SVG, a short silent video or a scripted drawing, with a control to pause it. MotifSpec ships one, a contour survey of generated terrain that slowly drifts.
42
42
 
43
43
  ## When to use
44
44
 
45
- - Once, beside the statement on a product's landing page that does not use the backdrop.
46
- - As the only decorative graphic on that page, and its only looping motion.
45
+ - Once, in a page's head, beside or below the statement: a landing page, or the head of a case study or post whose subject is easier to show than to say.
46
+ - For a moving picture of the subject, such as a product's interface at work or a process running, or for the contour survey as the page's one decorative graphic.
47
+ - As the only illustration on the page that loops.
47
48
 
48
49
  ## When not to use
49
50
 
50
- - On a page with the backdrop (`backdrop.md`), which already draws the survey behind it: one kind of contour field per page.
51
- - On article, index or 404 pages.
52
- - As a loading indicator, or as a map of a real place. It is generated, not surveyed.
53
- - Without its pause control.
51
+ - For a still image or diagram; that is a figure (`figure.md`), numbered from Plate 1.
52
+ - More than once on a page, or beside another animation.
53
+ - The contour survey on a page with the backdrop (`backdrop.md`), which draws the same survey behind it: one kind of contour field per page. Another illustration can sit on a backdrop page.
54
+ - As a loading indicator, or for anything a reader must watch to follow the page.
55
+ - For an animated GIF, or an SVG in an `<img>`: neither can be paused.
56
+ - Without its pause control, when it moves for longer than five seconds.
54
57
 
55
58
  ## Markup
56
59
 
57
- The build writes the plate to `dist/plate.html` (the contours at time zero) and ships the script as `dist/plate.js`. In Hugo, inline the markup and load the script; it finds every `.cx-plate[data-plate-seed]` on its own:
58
-
59
60
  ```html {preview=true}
60
61
  <figure class="cx-plate-frame">
61
62
  <label class="cx-plate__pause" hidden>
@@ -64,28 +65,73 @@ The build writes the plate to `dist/plate.html` (the contours at time zero) and
64
65
  <svg class="cx-icon" data-when="paused" aria-hidden="true" focusable="false"><use href="#cx-icon-play"></use></svg>
65
66
  <span class="cx-tooltip" aria-hidden="true"><span data-when="running">Pause animation</span><span data-when="paused">Play animation</span></span>
66
67
  </label>
67
- {{ (resources.Get "motifspec/plate.html").Content | safeHTML }}
68
- <figcaption>Plate 0 <span class="cx-sep" aria-hidden="true">|</span> Contour survey</figcaption>
68
+ <div class="cx-plate" data-plate-motion aria-hidden="true">
69
+ <svg class="cx-plate__map" viewBox="0 0 240 240" focusable="false">
70
+ <path class="cx-plate__grid" d="M80 0V240M160 0V240M0 80H240M0 160H240"/>
71
+ <path class="cx-plate__line" pathLength="1" d="M0 200C60 150 90 190 130 120S200 60 240 70"/>
72
+ <path class="cx-plate__line cx-plate__line--index" pathLength="1" d="M0 220C70 180 100 210 150 150S210 100 240 110"/>
73
+ <path class="cx-plate__line" pathLength="1" d="M60 240C90 200 140 220 170 180S220 150 240 150"/>
74
+ </svg>
75
+ </div>
76
+ <figcaption>Plate 0 <span class="cx-sep" aria-hidden="true">|</span> What it shows</figcaption>
69
77
  </figure>
70
- <script src="{{ (resources.Get "motifspec/plate.js" | minify | fingerprint).RelPermalink }}" defer></script>
71
78
  ```
72
79
 
73
- ## Do
80
+ The frame (`cx-plate-frame`) holds the pause control, the plate (`cx-plate`) and the caption. The plate is square, or 16:10 with `cx-plate--wide`, and whatever is inside it fills it:
81
+
82
+ <!-- caption: What a plate can hold -->
83
+ | Illustration | How it moves | How it pauses |
84
+ |---|---|---|
85
+ | An inline SVG | CSS animations or SMIL in the drawing | `dist/codex.js` stops both |
86
+ | A video | Muted, looping, no sound track, with a poster | `dist/codex.js` pauses it |
87
+ | A scripted drawing (SVG or canvas) | The site's own script | The script listens for `cx-plate-pause` |
88
+ | The contour survey | `dist/plate.js` | `dist/plate.js` |
89
+
90
+ Mark a plate whose illustration moves for longer than five seconds with `data-plate-motion`. `dist/codex.js` then reveals the pause control, pauses or plays the illustration with it, and sets `data-paused` on the frame while it is paused. Under `prefers-reduced-motion: reduce`, nothing plays, the control stays hidden, and CSS animations inside the plate don't run. The example above only draws in once, so it would leave `data-plate-motion` off; it carries it here to show the control.
74
91
 
75
- - Keep the survey conventions: 14 contour levels, every fifth an index contour (`color.ornament.strong`, `border.width.emphasis`), the rest hairlines in `color.ornament.rest`, over a quarter grid in `color.ornament.muted`.
76
- - Let each contour draw in once on load (`motion.duration.plate`, `motion.easing.enter`, staggered from the lowest line), then let the script start the drift: it eases up from rest over `motion.duration.plate`, then the terrain moves one noise unit every `motion.duration.drift`, linearly, and the lines are recomputed on every second frame.
92
+ The plate's drawing classes suit any line drawing, not only contours: `cx-plate__grid` for a quarter grid in `color.ornament.muted`, `cx-plate__line` for a hairline in `color.ornament.rest` that draws in once on load (give each path `pathLength="1"`), and `cx-plate__line--index` for the emphasised line in `color.ornament.strong`.
93
+
94
+ ### In Hugo
95
+
96
+ `partial "motifspec/specimen-plate.html"` writes the frame, the pause control and the caption around an asset, which it inlines (an `.svg` or `.html` file) or plays (an `.mp4` or `.webm` video):
97
+
98
+ ```go-html-template
99
+ {{ partial "motifspec/specimen-plate.html" (dict "src" "illustrations/sync.svg" "caption" "A sync in progress" "label" "Two devices exchange changes, then show the same list.") }}
100
+ {{ partial "motifspec/specimen-plate.html" (dict "src" "illustrations/tour.mp4" "poster" "illustrations/tour.png" "caption" "The editor" "wide" true) }}
101
+ {{ partial "motifspec/specimen-plate.html" (dict "src" "motifspec/plate.html" "caption" "Contour survey") }}
102
+ ```
103
+
104
+ `label` is the illustration's text alternative, for one that shows something a reader needs; without it the plate is decoration and `aria-hidden`. `dist/codex.js` and `dist/plate.js` load on every page through `head.html` and `body-end.html`.
105
+
106
+ ### The contour survey
107
+
108
+ MotifSpec's own plate: simplex-noise height lines drawn as a static SVG, which slowly reshape as the terrain drifts. The build writes it to `dist/plate.html` (the contours at time zero), with `data-plate-seed` on the plate, and `dist/plate.js` finds and runs every such plate on its own.
109
+
110
+ - Keep the survey conventions: 14 contour levels, every fifth an index contour, the rest hairlines, over the quarter grid.
111
+ - Each contour draws in once on load (`motion.duration.plate`, `motion.easing.enter`, staggered from the lowest line). Then the script starts the drift: it eases up from rest over `motion.duration.plate`, then the terrain moves one noise unit every `motion.duration.drift`, linearly, and the lines are recomputed on every second frame.
77
112
  - Change the terrain with `data-plate-seed` (and the matching `seed` option at build time), never by editing path data.
78
- - Keep the caption short: the plate number and what it shows.
113
+ - Don't speed up the drift or make it react to the pointer, and don't add elevation numbers, place names or a north arrow: it must not read as a real map.
114
+
115
+ ## Do
116
+
117
+ - Caption it "Plate 0" and what it shows, in a few words. Plate 0 is the one moving plate; figures count from 1.
118
+ - Colour an illustration of your own with MotifSpec's tokens (classes, or `var(--cx-color-…)` in the drawing's own styles), so it follows the theme.
119
+ - Time it with the motion tokens where it can (`var(--cx-motion-duration-…)`), and keep it slow: a loop the eye can rest on, not one that pulls at it.
120
+ - Draw it so it reads complete when still, at its first frame: that is what reduced motion, a paused plate and a page without script show.
121
+ - Give a video a poster, and no sound track.
79
122
 
80
123
  ## Don't
81
124
 
82
- - Don't speed up the drift, add a second animated plate, or make it react to the pointer.
83
- - Don't add elevation numbers, place names or a north arrow. It must not read as a real map.
84
- - Don't put text or links inside the plate.
125
+ - Don't put text, links or controls inside the plate, other than the pause control.
126
+ - Don't flash: nothing in it changes brightness sharply more than three times a second.
127
+ - Don't start it with sound, or show a video's own controls.
128
+ - Don't use the plate for a second animation on a page that already has one.
85
129
 
86
130
  ## Accessibility
87
131
 
88
- - The plate is `aria-hidden`; the caption is the only text.
89
- - WCAG 2.2.2 (Pause, Stop, Hide): the drift runs longer than five seconds, so the pause control (a native checkbox named "Pause animation") is reachable by keyboard and its checked state means paused. It ships `hidden` and the script reveals it only when the drift starts, so no dead control appears without JavaScript.
90
- - The script stops drawing while the plate is off screen or the tab is hidden, and never starts under `prefers-reduced-motion: reduce`; there, the contours render complete and still and the pause control stays hidden.
91
- - Contours are decorative: `color.ornament.rest` has no text-contrast requirement.
132
+ - A decorative plate is `aria-hidden`, and the caption is its only text. One that shows something a reader needs has a text alternative (`role="img"` and `aria-label`, or the partial's `label`), and its caption still says what it is.
133
+ - WCAG 2.2.2 (Pause, Stop, Hide): anything that moves for more than five seconds has the pause control, a native checkbox named "Pause animation" whose checked state means paused, reachable by keyboard. It ships `hidden`, and a script reveals it only when the illustration starts, so no dead control appears without JavaScript or under reduced motion.
134
+ - Under `prefers-reduced-motion: reduce` nothing plays: CSS animations don't run, SMIL and video stay paused, and the contour survey renders complete and still.
135
+ - WCAG 2.3.1 (Three Flashes): nothing flashes more than three times a second.
136
+ - The contour survey stops drawing while it is off screen or the tab is hidden.
137
+ - The drawing classes are decorative: `color.ornament.rest` has no text-contrast requirement.
@@ -0,0 +1,19 @@
1
+ ---
2
+ weight: 3
3
+ ---
4
+
5
+ # Colour
6
+
7
+ The primitive palette, and the semantic colours built on it that components and pages use, each with its light and dark value and its rule.
8
+
9
+ ## Palette
10
+
11
+ Five hues generated in OKLCH so the steps are perceptually even, stored as sRGB. Primitives are never used directly in components or pages: they exist so semantic colours can point at them.
12
+
13
+ *Generated from `tokens/color.json`: the palette.*
14
+
15
+ ## Semantic colours
16
+
17
+ Each semantic colour names a primitive for each theme, and the page switches with `light-dark()`, following the system unless the reader picks a theme. A text colour lists the surfaces it may sit on; [Contrast pairs](/reference/contrast/) measures every one.
18
+
19
+ *Generated from `tokens/color.json`: semantic colours.*
@@ -0,0 +1,13 @@
1
+ ---
2
+ weight: 7
3
+ ---
4
+
5
+ # Icons
6
+
7
+ The approved icons, each for its listed use: Material Symbols in the Sharp style at weight 300, self-hosted as a sprite.
8
+
9
+ ## Approved icons
10
+
11
+ Use them as `icon.md` says: beside text that says the same thing, from the sprite.
12
+
13
+ *Generated from `icons/manifest.json`: the icons.*
@@ -0,0 +1,14 @@
1
+ ---
2
+ weight: 6
3
+ toc: false
4
+ ---
5
+
6
+ # Motion
7
+
8
+ The durations and curves for the few things that move. Under reduced motion every duration is zero.
9
+
10
+ ## Durations and curves
11
+
12
+ Only state changes animate, and the contour survey ([Principles](/foundations/principles/)).
13
+
14
+ *Generated from `tokens/motion.json`: motion tokens.*
@@ -0,0 +1,21 @@
1
+ ---
2
+ weight: 8
3
+ ---
4
+
5
+ # Ornaments
6
+
7
+ The approved Yarndings 12 glyphs, by group, and the ones that are never used. Ornaments are decoration only, always hidden from assistive tech (`ornament.md`).
8
+
9
+ ## Roles
10
+
11
+ The system's own ornaments always use these glyphs.
12
+
13
+ *Generated from `tokens/typography.json`: ornament roles.*
14
+
15
+ ## Approved glyphs
16
+
17
+ *Generated from `tokens/typography.json`: approved glyphs.*
18
+
19
+ ## Never used
20
+
21
+ *Generated from `tokens/typography.json`: forbidden glyphs.*
@@ -0,0 +1,26 @@
1
+ ---
2
+ weight: 5
3
+ toc: false
4
+ ---
5
+
6
+ # Space and size
7
+
8
+ A 4px spacing grid with roles for padding and gaps, and the sizes, radii and borders components are drawn with.
9
+
10
+ ## Spacing
11
+
12
+ Components use the semantic roles: inset is padding, stack is a vertical gap, inline a horizontal gap, and section and gutter space out a page. The steps they point at, to scale:
13
+
14
+ *Generated from `tokens/space.json`: spacing steps.*
15
+
16
+ *Generated from `tokens/space.json`: space tokens.*
17
+
18
+ ## Size
19
+
20
+ *Generated from `tokens/size.json`: size tokens.*
21
+
22
+ ## Radius and border
23
+
24
+ *Generated from `tokens/radius.json`: radius tokens.*
25
+
26
+ *Generated from `tokens/border.json`: border tokens.*
@@ -0,0 +1,22 @@
1
+ ---
2
+ weight: 4
3
+ toc: false
4
+ ---
5
+
6
+ # Type
7
+
8
+ The typefaces, the type scale and the weights, leading and tracking that set every piece of text.
9
+
10
+ ## Typefaces
11
+
12
+ *Generated from `tokens/typography.json`: typefaces.*
13
+
14
+ ## Type scale
15
+
16
+ Sizes are fluid between the smallest and widest screens, and the smallest stay fixed so labels never shrink. Each sample is set at its size.
17
+
18
+ *Generated from `tokens/typography.json`: the type scale.*
19
+
20
+ ## Weight, leading and tracking
21
+
22
+ *Generated from `tokens/typography.json`: weight, leading and tracking.*
package/docs/hugo.md CHANGED
@@ -86,7 +86,7 @@ enableGitInfo = true # Lastmod from Git, for "Last updated"
86
86
 
87
87
  [params.motifspec]
88
88
  layout = "documentation"
89
- editURL = "https://github.com/owner/repo/edit/main/"
89
+ sourceURL = "https://github.com/owner/repo/blob/main/"
90
90
  ```
91
91
 
92
92
  The templates are `layouts/page.markdown.md`, `section.markdown.md` and `home.markdown.md`; a site's own file at the same path wins.
@@ -124,6 +124,7 @@ Every partial below is called as `partial "motifspec/<name>.html" <context>`.
124
124
  | `accession/id.html` | `accession-label.md` | A page. The compact number, date and reading time line. |
125
125
  | `accession/status.html` | `accession-label.md` | `live`, `building` or `archived`. |
126
126
  | `figure.html` | `figure.md` | `dict "image" <resource> "alt" "…" "caption" <HTML> "plate" 1`, plus `"eager" true` for the largest image above the fold and `"prose" true` to keep it to the text measure. |
127
+ | `specimen-plate.html` | `specimen-plate.md` | `dict "src" "illustrations/x.svg" "caption" "…"`, plus `"label"` for one a reader needs, `"poster"` for a video and `"wide" true` for 16:10. Inlines an `.svg` or `.html` asset (`"motifspec/plate.html"` is the contour survey) or plays an `.mp4` or `.webm`, in the frame with its pause control and "Plate 0" caption. |
127
128
  | `table-of-contents.html` | `table-of-contents.md` | A page. `article.html` already calls it. |
128
129
  | `tags.html` | `tag.md` | `dict "page" . "max" 3`. |
129
130
  | `tag-filter.html` | `tag.md` | `dict "section" "work" "current" nil` on a section page, or `dict "section" "" "current" .` on a term page. |
@@ -132,7 +133,7 @@ Every partial below is called as `partial "motifspec/<name>.html" <context>`.
132
133
  | `pagination-pages.html` | `pagination.md` | `dict "pager" $pager "label" "Writing pages"`. Pages of a paginated list; nothing when it fits on one page. |
133
134
  | `docs-nav.html` | `docs-shell.md` | A page. The documentation layout's navigation: top-level pages, then a group per top-level section in weight order. `docs_nav: false` in front matter leaves a page or section out. |
134
135
  | `page-actions.html` | `page-actions.md` | A page. Copy page and View as Markdown, when the page has the markdown output format; nothing otherwise. |
135
- | `page-footer.html` | `page-footer.md` | A page. Last updated (its `Lastmod`) and Edit this page, from `params.motifspec.editURL` and, for a site in a folder of its repository, `params.motifspec.siteDir`; a page with no file of its own uses its `source` param, the repository path of the file it was made from. |
136
+ | `page-footer.html` | `page-footer.md` | A page. Last updated (its `Lastmod`), Generated from (its `data` param) and View source, from `params.motifspec.sourceURL` (or Edit this page, from `editURL`) and, for a site in a folder of its repository, `params.motifspec.siteDir`. A page with no file of its own sets `source` and, for one section of a file, `sourceAnchor`. |
136
137
  | `pagination-docs.html` | `pagination.md`, `page-footer.md` | A page. Previous and next in the order `docs-nav.html` lists the pages. |
137
138
  | `search.html` | `search.md` | A page. The search trigger and dialog; `site-header.html` calls it when `params.motifspec.search` is true. |
138
139
  | `back-link.html` | `button-and-link.md` | `dict "href" "…" "label" "All work"`. |
@@ -22,7 +22,7 @@ Every template sits on the backdrop (`backdrop.md`): its contours show behind th
22
22
 
23
23
  ## Components
24
24
 
25
- Every shared component, plus the components whose doc lists `portfolio` under `layouts:`: accession label, backdrop, heading anchor, ornament, post list item, project card, specimen plate and table of contents.
25
+ Every shared component, plus the components whose doc lists `portfolio` under `layouts:`: accession label, backdrop, heading anchor, ornament, post list item, project card and table of contents.
26
26
 
27
27
  ## Catalogue numbers
28
28
 
@@ -0,0 +1,13 @@
1
+ ---
2
+ weight: 3
3
+ ---
4
+
5
+ # Checker rules
6
+
7
+ What the checker reports, and what to do instead. Rules that warn will fail the run in a later release.
8
+
9
+ ## Rules
10
+
11
+ *Generated from `scripts/check.mjs`: checker rules.*
12
+
13
+ [Checking a project](/guide/checking/) says how to run it.
@@ -0,0 +1,18 @@
1
+ ---
2
+ weight: 2
3
+ toc: false
4
+ ---
5
+
6
+ # Contrast pairs
7
+
8
+ Every foreground and the surfaces it may sit on (`codex.pairsWith`), measured in both themes on every build.
9
+
10
+ ## Targets
11
+
12
+ Reading text targets 7:1, metadata and status labels 4.5:1, and controls, focus and graphics 3:1. Each sample is drawn in the pair's own colours for that theme.
13
+
14
+ *Generated from `tokens/color.json`: the contrast summary.*
15
+
16
+ ## Pairs
17
+
18
+ *Generated from `tokens/color.json`: contrast pairs.*
@@ -0,0 +1,14 @@
1
+ ---
2
+ weight: 1
3
+ toc: false
4
+ ---
5
+
6
+ # Tokens
7
+
8
+ Every semantic token, with its value and rule. Pages and components use these; the primitives behind them are not for use outside MotifSpec.
9
+
10
+ *Generated from `tokens/`: deprecated tokens.*
11
+
12
+ A token's CSS name is `--cx-` and its name with dashes: `color.text.primary` is `--cx-color-text-primary`. A colour shows its light value, then its dark one.
13
+
14
+ *Generated from `tokens/`: every semantic token.*
@@ -9,6 +9,7 @@
9
9
  {{- range split .Inner "\n" }}{{ if gt (strings.RuneCount .) $measure }}{{ $long = true }}{{ end }}{{ end -}}
10
10
  {{- $result := transform.HighlightCodeBlock . -}}
11
11
  {{- $preview := and .Attributes.preview (eq $lang "html") -}}
12
+ {{- if and $preview (strings.Contains .Inner "{{") }}{{ errorf "%s: an example with Hugo template syntax can't be previewed. Fence it as go-html-template, or show the HTML it writes." .Page.Path }}{{ end -}}
12
13
  {{- if $preview }}
13
14
  {{- $css := resources.Get "motifspec/codex.css" | resources.Copy "cx/codex.css" | minify | fingerprint -}}
14
15
  {{- $js := resources.Get "motifspec/codex.js" | resources.Copy "cx/codex.js" | minify | fingerprint -}}
@@ -1,24 +1,39 @@
1
- {{- /* page-footer.md: when the page last changed (its Lastmod; with enableGitInfo, from Git) and a link to edit its
2
- source. The edit link needs params.motifspec.editURL, the repository's edit address ending in "/", such as
3
- "https://github.com/owner/repo/edit/main/". When the site lives in a folder of the repository, also set
4
- params.motifspec.siteDir to that folder, so files mounted from outside it get the right path. A page with no
5
- file of its own, such as one a content adapter makes from another file, names that file's path in the
6
- repository as its `source` param. Context: a page. */ -}}
1
+ {{- /* page-footer.md: when the page last changed (its Lastmod; with enableGitInfo, from Git), what its generated parts
2
+ come from, and a link to its source. Context: a page.
3
+ - The link needs the repository's address for viewing files, params.motifspec.sourceURL, such as
4
+ "https://github.com/owner/repo/blob/main/" ("View source"), or for editing them, params.motifspec.editURL,
5
+ such as "https://github.com/owner/repo/edit/main/" ("Edit this page"). With both, View source is shown.
6
+ - The path is the page's file. When the site lives in a folder of the repository, set params.motifspec.siteDir to
7
+ that folder. A page with no file of its own, such as one a content adapter makes from another file, names that
8
+ file's repository path as its `source` param, and `sourceAnchor` for the heading it starts at, if it is one
9
+ section of the file (View source only; an editor can't open at a heading).
10
+ - A page whose tables or lists are generated names the files they come from as its `data` param (a list of
11
+ repository paths), shown after the date and linked with sourceURL. */ -}}
7
12
  {{- $p := . -}}
13
+ {{- $path := "" -}}
14
+ {{- with $p.Params.source -}}
15
+ {{- $path = strings.TrimPrefix "/" . -}}
16
+ {{- else with $p.File -}}
17
+ {{- $root := strings.TrimSuffix (printf "/%s" (site.Params.motifspec.siteDir | default "" | strings.Trim "/")) hugo.WorkingDir -}}
18
+ {{- $path = strings.TrimPrefix (printf "%s/" $root) .Filename -}}
19
+ {{- end -}}
20
+ {{- $view := "" -}}
8
21
  {{- $edit := "" -}}
9
- {{- with site.Params.motifspec.editURL -}}
10
- {{- $base := . -}}
11
- {{- with $p.Params.source -}}
12
- {{- $edit = printf "%s%s" $base (strings.TrimPrefix "/" .) -}}
13
- {{- else with $p.File -}}
14
- {{- $root := strings.TrimSuffix (printf "/%s" (site.Params.motifspec.siteDir | default "" | strings.Trim "/")) hugo.WorkingDir -}}
15
- {{- $edit = printf "%s%s" $base (strings.TrimPrefix (printf "%s/" $root) .Filename) -}}
16
- {{- end -}}
22
+ {{- with and $path site.Params.motifspec.sourceURL -}}
23
+ {{- $view = printf "%s%s%s" . $path (cond (ne ($p.Params.sourceAnchor | default "") "") (printf "#%s" $p.Params.sourceAnchor) "") -}}
24
+ {{- else with and $path site.Params.motifspec.editURL -}}
25
+ {{- $edit = printf "%s%s" . $path -}}
17
26
  {{- end -}}
18
- {{- if or (not $p.Lastmod.IsZero) $edit }}
27
+ {{- if or (not $p.Lastmod.IsZero) $view $edit }}
19
28
  <footer class="cx-page-footer" data-pagefind-ignore>
20
- {{- if not $p.Lastmod.IsZero }}
21
- <p class="cx-meta">Last updated <time datetime="{{ $p.Lastmod.Format "2006-01-02" }}">{{ $p.Lastmod.Format "2 January 2006" }}</time></p>
29
+ {{- if or (not $p.Lastmod.IsZero) $p.Params.data }}
30
+ <p class="cx-meta">
31
+ {{- if not $p.Lastmod.IsZero }}Last updated <time datetime="{{ $p.Lastmod.Format "2006-01-02" }}">{{ $p.Lastmod.Format "2 January 2006" }}</time>{{ end }}
32
+ {{- with $p.Params.data }}{{ if not $p.Lastmod.IsZero }} <span class="cx-sep" aria-hidden="true">|</span> {{ end }}<span>Generated from {{ range $i, $d := . }}{{ if $i }}{{ if eq $i (sub (len $p.Params.data) 1) }} and {{ else }}, {{ end }}{{ end }}{{ with site.Params.motifspec.sourceURL }}<a href="{{ . }}{{ $d }}">{{ $d }}</a>{{ else }}{{ $d }}{{ end }}{{ end }}</span>{{ end -}}
33
+ </p>
34
+ {{- end }}
35
+ {{- with $view }}
36
+ <a class="cx-link" href="{{ . }}">View source<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-outward"></use></svg></a>
22
37
  {{- end }}
23
38
  {{- with $edit }}
24
39
  <a class="cx-link" href="{{ . }}"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-edit"></use></svg>Edit this page<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-outward"></use></svg></a>
@@ -0,0 +1,33 @@
1
+ {{- /* specimen-plate.md: a framed, captioned illustration that moves, with its pause control. dist/codex.js (for an
2
+ illustration of the site's own) or dist/plate.js (for the contour survey) reveals the control and runs it; both
3
+ load on every page through head.html and body-end.html. Context: dict
4
+ "src" an asset path: an .svg or .html file to inline, such as "motifspec/plate.html" (MotifSpec's contour
5
+ survey) or one of the site's own in assets/, or a video (.mp4 or .webm)
6
+ "caption" what it shows, after "Plate 0"
7
+ "label" the illustration's text alternative, when it shows something a reader needs. Without it, the plate is
8
+ decoration and hidden from assistive tech.
9
+ "poster" for a video: an image asset shown before it plays, and instead of it under reduced motion
10
+ "wide" true for a 16:10 plate instead of a square one */ -}}
11
+ {{- $r := resources.Get .src -}}
12
+ {{- if not $r }}{{ errorf "specimen-plate.html: %q is not an asset (assets/, or a module's mount)." .src }}{{ end -}}
13
+ {{- if not .caption }}{{ errorf "specimen-plate.html: %q needs a caption: what the plate shows (specimen-plate.md)." .src }}{{ end -}}
14
+ {{- $video := in (slice "mp4" "webm") $r.MediaType.SubType -}}
15
+ {{- $own := and (not $video) (hasPrefix (strings.TrimSpace $r.Content) `<div class="cx-plate"`) -}}
16
+ {{- $class := cond (eq .wide true) "cx-plate cx-plate--wide" "cx-plate" -}}
17
+ {{- $name := cond (ne (.label | default "") "") (printf ` role="img" aria-label="%s"` (.label | htmlEscape)) ` aria-hidden="true"` -}}
18
+ <figure class="cx-plate-frame">
19
+ <label class="cx-plate__pause" hidden>
20
+ <input class="cx-visually-hidden" type="checkbox" aria-label="Pause animation">
21
+ <svg class="cx-icon" data-when="running" aria-hidden="true" focusable="false"><use href="#cx-icon-pause"></use></svg>
22
+ <svg class="cx-icon" data-when="paused" aria-hidden="true" focusable="false"><use href="#cx-icon-play"></use></svg>
23
+ <span class="cx-tooltip" aria-hidden="true"><span data-when="running">Pause animation</span><span data-when="paused">Play animation</span></span>
24
+ </label>
25
+ {{- if $own }}
26
+ {{ $r.Content | safeHTML }}
27
+ {{- else if $video }}
28
+ <div class="{{ $class }}" data-plate-motion{{ safeHTMLAttr $name }}><video src="{{ $r.RelPermalink }}" muted loop playsinline preload="metadata"{{ with .poster }}{{ with resources.Get . }} poster="{{ .RelPermalink }}"{{ end }}{{ end }}></video></div>
29
+ {{- else }}
30
+ <div class="{{ $class }}" data-plate-motion{{ safeHTMLAttr $name }}>{{ $r.Content | safeHTML }}</div>
31
+ {{- end }}
32
+ <figcaption>Plate 0 <span class="cx-sep" aria-hidden="true">|</span> {{ .caption }}</figcaption>
33
+ </figure>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aitrien/motifspec",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "Liam Marshall's design system: DTCG tokens, component rules, generated CSS, Hugo templates and a rule checker.",
5
5
  "keywords": [
6
6
  "design-system",