@monospaced/set-skills 0.26.0 → 0.27.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/DESIGN.md CHANGED
@@ -104,8 +104,8 @@ How each page or screen uses the grid and space: where the emphasis goes, how th
104
104
  _One treatment makes every brand image look rendered on the same display. Our own photos, never stock._
105
105
  - Graphics, from a mark, chart, diagram or ornament to a poster-scale composition, are drawn from the system's materials: type, glyphs, cells, dithers, color, lines and simple shapes. Drawn graphics are the second route to brand imagery, alongside the treated photograph.
106
106
  _Early screens, print graphic design and early computer art made pictures from these same materials, so drawn graphics carry the brand's lineage._
107
- - Crop with intent: tight and cut by the edge beats the whole thing centred. Images doing the same job share a ratio and treatment.
108
- _Swiss practice. Scale and crop make an image active, and consistency lets difference mean something._
107
+ - Images doing the same job share a ratio and treatment.
108
+ _Consistency lets difference mean something._
109
109
  - Shading is made of square pixels, never smooth blends: two colors in an ordered pattern, with pixels big enough to see. No gradients, blurs or glows.
110
110
  _Graphics mode: how early screens made tone._
111
111
  - Halftones and overprinting interrupt: a print moment among the square pixels, not the base.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monospaced/set-skills",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Markdown guardrails for AI coding agents (and humans) building sites and apps with Set: the set skill, a skill for each mode, and DESIGN.md.",
5
5
  "repository": {
6
6
  "type": "git",
package/src/set/SKILL.md CHANGED
@@ -42,6 +42,8 @@ If a request names a mode the project doesn't have, stay in an installed mode an
42
42
 
43
43
  The `$description` confirms the intent: read it before using a token whose name sounds right. Use a token of the right kind for each property: never a horizontal spacing token for vertical space, for example.
44
44
 
45
+ Canvas and WebGL can't read custom properties, so read tokens with `@monospaced/set-core`'s `resolveSet*` helpers.
46
+
45
47
  ### CSS architecture
46
48
 
47
49
  Custom CSS sits alongside Set's own:
@@ -92,13 +94,13 @@ All UI meets [WCAG 2.2 AA](https://www.w3.org/TR/WCAG22/).
92
94
  ### Color and theme
93
95
 
94
96
  - **Color comes from surfaces and Set's color tokens, each used for its described role.**
95
- - **Everything works in light and dark themes.** In CSS, color tokens handle this. Graphics drawn in canvas or WebGL read the tokens again and redraw when the theme changes.
97
+ - **Everything works in light and dark themes.** In CSS, color tokens handle this. Graphics drawn in canvas or WebGL read the tokens again and redraw when `watchSetTokens` reports a change.
96
98
  - **Theme follows the user's preference (`prefers-color-scheme`) by default.** To offer a theme switch on the page, use Set's `Lightswitch`, but only when it can be kept permanently in view, such as in a fixed or sticky header.
97
99
  - **Theme changes color, never layout.** Nothing moves or resizes between light and dark.
98
100
 
99
101
  ### Motion
100
102
 
101
- - **Under `prefers-reduced-motion`, nothing moves.** Where the motion carries meaning, a non-moving change, such as a fade, can stand in. Canvas and WebGL don't get this for free: check the preference and render the designed still.
103
+ - **Under `prefers-reduced-motion`, nothing moves.** Where the motion carries meaning, a non-moving change, such as a fade, can stand in. Canvas and WebGL don't get this for free: render a designed still. `runSetFrames` holds a stepped graphic on its still under reduced motion.
102
104
 
103
105
  ### Imagery
104
106
 
@@ -106,7 +108,8 @@ All UI meets [WCAG 2.2 AA](https://www.w3.org/TR/WCAG22/).
106
108
  - **Text over a treated photograph:** use `Poster`. An adaptive image follows the theme by itself. Otherwise, lock the content to the image with `contentTheme`: `dark` for a dark image, `light` for a light one. A mid-tone image has no contrast guarantee for text.
107
109
  - **Screen exports scale smoothly.** Never apply `image-rendering: pixelated` to them: on a fluid image it causes moiré. One export is fine. Several, served through `Image` as width-keyed sources, can keep the dot size between about 0.75 and 2.25 CSS px as the image grows.
108
110
  - **Dithered type or shapes:** mask the element with a `--set-shape-dither-*-image` token and the matching `--set-shape-dither-tile-*` size, keeping the real text in the DOM. The smaller the type, the smaller the cell, so it still reads. It suits short text read at a glance, never running text.
109
- - **Graphics performance:** keep the work per frame low, pause when off-screen or hidden, and redraw only when something changes. Draw crisp pixel graphics at device resolution, with cells a whole number of device pixels, redrawing on resize.
111
+ - **Graphics performance:** keep the work per frame low, pause when off-screen or hidden, and redraw only when something changes. `runSetFrames` steps a moving graphic at a frame period and pauses it for you.
112
+ - **Crisp pixel graphics:** draw at device resolution, with cells a whole number of device pixels, redrawing on resize. `sizeSetCanvas` keeps a canvas at its device pixels, and `fillSetDither` and `createSetDitherPattern` draw ordered dither in whole cells. Never apply `image-rendering: pixelated` to a canvas: at a fractional pixel ratio it leaves cells uneven.
110
113
 
111
114
  ## Checks
112
115
 
@@ -27,7 +27,9 @@ Custom markup and CSS is on a par with Set components everywhere: use whichever
27
27
 
28
28
  - **Font size** comes from components, or type composites and type steps. For display type, it can also be fluid between any two type steps, or fit to its container's width. The line height for each:
29
29
  - **Fluid:** runs between the two steps' line heights, rounded up to the 6px grid.
30
- - **Fit to width:** line height 1, with the type on one line or broken by hand, and any space above and below from vertical spacing tokens.
30
+ - **Fit to width:** the type sits on one line, or is broken by hand over several.
31
+ - **One line:** line height 1, and any space above and below from vertical spacing tokens.
32
+ - **Two or more lines:** as one line, then adjusted with the font metric tokens (`--set-typography-metric-*`) to suit how the lines' letters meet. For example, tighter where a line with no descenders sits over one with no ascenders, or padded where a descender hangs below the last line.
31
33
  - **Weight and width** come from components, type tokens, or any value on the font's axes.
32
34
  - **Slant** comes from semantic elements in copy, such as `em` and `cite`, `font-style: italic`, or any angle on the font's slant axis, set with `'slnt'` in `font-variation-settings`.
33
35
 
@@ -27,7 +27,9 @@ For layout and expression, custom markup and CSS is on a par with Set components
27
27
 
28
28
  - **Font size** comes from components, or type composites and type steps. For display type, it can also be fluid between any two type steps, or fit to its container's width. The line height for each:
29
29
  - **Fluid:** runs between the two steps' line heights, rounded up to the 6px grid.
30
- - **Fit to width:** line height 1, with the type on one line or broken by hand, and any space above and below from vertical spacing tokens.
30
+ - **Fit to width:** the type sits on one line, or is broken by hand over several.
31
+ - **One line:** line height 1, and any space above and below from vertical spacing tokens.
32
+ - **Two or more lines:** as one line, then adjusted with the font metric tokens (`--set-typography-metric-*`) to suit how the lines' letters meet. For example, tighter where a line with no descenders sits over one with no ascenders, or padded where a descender hangs below the last line.
31
33
  - **Weight and width** come from components or type tokens. At 28px (type step 600) and up, any weight token can pair with any width token.
32
34
  - **Slant** comes from semantic elements in copy, such as `em` and `cite`, or `font-style: italic`.
33
35