@sloppy-ai/skill 0.0.0-stage → 1.4.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/SKILL.md +95 -0
- package/package.json +23 -4
- package/references/annotations.md +76 -0
- package/references/backgrounds.md +30 -0
- package/references/bento.md +63 -0
- package/references/brands.md +32 -0
- package/references/choreography.md +32 -0
- package/references/craft.md +160 -0
- package/references/framing.md +106 -0
- package/references/kit.md +185 -0
- package/references/looks.md +66 -0
- package/references/motion.md +185 -0
- package/references/products.md +26 -0
- package/references/rehearse.md +117 -0
- package/references/review.md +26 -0
- package/references/teaching.md +111 -0
- package/references/verify.md +84 -0
- package/skill.json +17 -0
- package/README.md +0 -3
package/SKILL.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sloppy
|
|
3
|
+
description: The AI slop UI & code fixer. Eliminates purple gradients, sparkle icons, boxed cards, floating frames, unearned loops, fake copy, and low-evidence TypeScript via 3-tier severity gates (Floor/Reflex/Finish), wiring guards, multi-width checks, decoupled looks, and MCP tools.
|
|
4
|
+
metadata:
|
|
5
|
+
version: 1.5.0
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Sloppy: Anti-Slop Engine
|
|
9
|
+
|
|
10
|
+
Eliminate AI UI and TypeScript slop with deterministic source scanning, 3-tier severity gates, surgical fixes, 100-point craft grading, 5 MIT UI libraries, and 21 permissive (`MIT`/`Apache-2.0`) motion ecosystems.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## The Ponytail Lazy UI Design Ladder (Anti-Overengineering)
|
|
15
|
+
|
|
16
|
+
"The best UI is the UI you never had to render." When designing or implementing UI, AI agents must climb the Ponytail UI Ladder and stop at the lowest rung that solves the user's immediate need:
|
|
17
|
+
|
|
18
|
+
1. **Rung 1: UI YAGNI (You Aren't Gonna Need It)**
|
|
19
|
+
- Question every single visual widget, filter pill, search bar, secondary tab, export menu, and settings modal.
|
|
20
|
+
- If the user or spec did not explicitly ask for it, **do not build it**. Never generate speculative dashboard clutter or decorative chrome to "fill space".
|
|
21
|
+
2. **Rung 2: Native Platform Primitives First**
|
|
22
|
+
- Reach for native HTML and CSS before reaching for bespoke component wrappers or hand-rolled div soup:
|
|
23
|
+
- Use `<button type="button">` (not clickable `<div>` with state).
|
|
24
|
+
- Use `<dialog>` or native modal mechanisms.
|
|
25
|
+
- Use `<input type="date">`, `<select>`, `<input type="checkbox">` before assembling a 250-line custom dropdown.
|
|
26
|
+
- Use standard CSS grid/flexbox, `:has()`, and `accent-color` before adding layout calculation libraries.
|
|
27
|
+
3. **Rung 3: Single Surface Elevation (No Nested Card Bloat)**
|
|
28
|
+
- Stop nesting cards inside cards inside cards (`border border-neutral-800 rounded-xl p-4`).
|
|
29
|
+
- Use 1 clean, restrained surface step (`0 -> 1 -> 2`). Separate sub-items with clean vertical whitespace, subtle dividers (`divide-y divide-neutral-800/60`), or quiet indentation—never another bordered card container.
|
|
30
|
+
4. **Rung 4: Restrained Motion & Functional Transitions**
|
|
31
|
+
- Motion is strictly functional: orient spatial hierarchy on state changes.
|
|
32
|
+
- Prefer standard CSS transitions (`transition-opacity duration-150`) over heavy physics engines.
|
|
33
|
+
- Zero decorative infinite loops (`animate-bounce`, continuous rotation, unearned shimmers). Always guard with `useReducedMotion()` / `prefers-reduced-motion` (`MOT-03`).
|
|
34
|
+
5. **Rung 5: Radical Information & Copy Restraint**
|
|
35
|
+
- Strict word budget: 3–7 words per hero/card headline.
|
|
36
|
+
- Never invent marketing cheerleading or fake analytics stats.
|
|
37
|
+
- Use quiet neutral placeholder rows (`<Bar />` / `<div className="h-2 w-16 bg-muted rounded" />`) for peripheral secondary data.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Progressive Specialist Skills (Load On-Demand Only)
|
|
42
|
+
|
|
43
|
+
Load only the specialist needed for your active domain to minimize context tokens:
|
|
44
|
+
|
|
45
|
+
| Specialist | Domain | Covered Rules |
|
|
46
|
+
| :--- | :--- | :--- |
|
|
47
|
+
| `sloppy-ui` | Surface elevation (0–3), single accent, Lucide replacement, liveliness | `VIS-01`..`03`, `VIS-06`..`08`, `MED-02`, `LIV-01` |
|
|
48
|
+
| `sloppy-copywriting` | 3–7 word budgets, concrete metrics, zero clichés | `CPY-01`, `CPY-02`, `CPY-04`..`07`, `TYP-08` |
|
|
49
|
+
| `sloppy-human` | Real product chrome, domain nouns, honest error/empty states | Chrome & microcopy authenticity |
|
|
50
|
+
| `sloppy-layoutmobile` | `>=66%` stage coverage, edge bleed, varied layouts, scroll safety | `STR-01`, `STR-02`, `UX-05` |
|
|
51
|
+
| `sloppy-code` | Accessible controls, valid handlers, stacking tokens, TS evidence | `AX-01`, `UX-02`, `TOK-01`, `COD-01`..`06` |
|
|
52
|
+
|
|
53
|
+
Deep topic guides (open only when needed): `references/craft.md`, `references/framing.md`, `references/motion.md`, `references/kit.md`, `references/bento.md`, `references/looks.md`, `references/verify.md`.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 3-Tier Severity Gates
|
|
58
|
+
|
|
59
|
+
1. **Floor (Hard CI Blockers)**: Contrast (`VIS-08`), dead handlers/links (`UX-02`), clickable `<div>` (`AX-01`), fabricated metrics (`CPY-01`), lorem ipsum (`CPY-07`), scroll lock (`UX-05`), `z-[9999]` (`TOK-01`), chained `!` (`COD-06`), missing reduced-motion (`MOT-03`). Never bypassed.
|
|
60
|
+
2. **Reflex (Overrulable AI Defaults)**: Purple gradients (`VIS-02`), gradient hero text (`VIS-01`), emerald monoculture (`VIS-03`), sparkles (`MED-02`), boxed cards (`STR-01`), floating frames (`STR-02`), infinite/layout-thrash motion (`MOT-01`, `MOT-02`, `MOT-04`), chained casts / `any` returns (`COD-02`, `COD-03`, `COD-04`). Pass in CI only with written rationale in `sloppy.config.json` (`overrules`) or inline:
|
|
61
|
+
`// sloppy-override: VIS-02 Client brand requirement`
|
|
62
|
+
3. **Finish (Advisory)**: Narration comments (`COD-01`), empty object spreads (`COD-05`), sterile surfaces (`LIV-01`), minor rhythm polish. Never blocks CI.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Token-Efficient Agent Workflow (MCP & CLI)
|
|
67
|
+
|
|
68
|
+
Use the 5 primary MCP tools with compact/summary flags to keep context lean:
|
|
69
|
+
- `sloppy_check({ path, strict: true, compact: true })` — Run before and after edits; `compact: true` skips prose rubric feedback.
|
|
70
|
+
- `sloppy_plan({ path, look })` — Dry-run repair plan and unified diff.
|
|
71
|
+
- `sloppy_fix({ path, only: [1, "VIS-02"], write: true })` — Surgical rewrite protected by the `--kept` wiring guard (`href`, `onClick`, form controls, headings). Omits duplicate `transformedCode` when `write: true`.
|
|
72
|
+
- `sloppy_catalog({ query, type, detail: "summary", limit: 10 })` — Search 5 MIT component libs (`stageshow`, `shadcn`, `motion-primitives`, `magicui`, `kokonutui`), 21 permissive motion ecosystems (`type: "motion"`), 74 patterns, 10 archetypes, and decoupled materials (`looks`). Pass `detail: "full"` only for source snippets.
|
|
73
|
+
- `sloppy_rules({ topic, ruleId, tier, compact: true })` — Query guidelines, project stack (`topic: "stack"`), or single canonical rules (`ruleId: "MOT-03"`).
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Fast agent CLI gates
|
|
77
|
+
sloppy check src/ --changed --strict --compact --json
|
|
78
|
+
sloppy audit src/ --code --strict --compact --json
|
|
79
|
+
sloppy audit src/Hero.tsx --mode after && sloppy fix src/Hero.tsx --only 1,3 --write
|
|
80
|
+
sloppy verify http://127.0.0.1:1355 --a11y --multi-width
|
|
81
|
+
sloppy init [--from <url>] && sloppy hook install
|
|
82
|
+
sloppy libs && sloppy list motion && sloppy looks --next
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Core Craft Summary (7 Rules)
|
|
88
|
+
|
|
89
|
+
1. **Ground & Elevate**: Step surfaces `0 -> 1 -> 2 -> 3` (`bg-neutral-950` -> `neutral-900` -> `neutral-800`) instead of wrapping everything in identical bordered cards.
|
|
90
|
+
2. **Budget Copy**: Keep 3–7 real strings per hero/illustration (`<Bar />` for filler copy); no lorem ipsum or invented round-number metrics.
|
|
91
|
+
3. **Frame & Bleed**: Fill `>= 66%` of stage width and bleed filler off at least one edge; test across 8 widths (375px–1920px).
|
|
92
|
+
4. **Purposeful Motion**: Guard all animations with `useReducedMotion()` / `prefers-reduced-motion` (`MOT-03`), animate `transform`/`opacity` only (`MOT-04`), avoid static infinite loops (`MOT-02`), and clean up Three.js/R3F/Pixi/Lenis/Lottie instances (`MOT-05`).
|
|
93
|
+
5. **Authentic Chrome & Icons**: Use product-appropriate icons (`Activity`, `Zap`, `Terminal`, `Database`), never decorative sparkles or raw emojis (`MED-01`).
|
|
94
|
+
6. **TypeScript Honesty**: Zero `as unknown as T`, unvalidated `any`/`unknown` returns, `Record<string, any>`, or `foo!.bar`. Strict ignores require rationale (`// sloppy-ignore-next-line RULE -- reason`).
|
|
95
|
+
7. **Target Grade A+ (>=95/100)**: Run `sloppy rubric <file>` and `sloppy check --strict` before declaring completion. Keep code and docs free of emojis and follow Conventional Commits.
|
package/package.json
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sloppy-ai/skill",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "The ultimate AI slop UI fixer combining Stageshow craft, 7 UI ecosystems, surgical auto-fixer, 3-tier severity gates (Floor/Reflex/Finish), and wiring guard.",
|
|
5
|
+
"main": "SKILL.md",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"SKILL.md",
|
|
11
|
+
"skill.json",
|
|
12
|
+
"references"
|
|
13
|
+
],
|
|
14
|
+
"keywords": [
|
|
15
|
+
"skill",
|
|
16
|
+
"ai-slop",
|
|
17
|
+
"antigravity",
|
|
18
|
+
"claude-code",
|
|
19
|
+
"cursor",
|
|
20
|
+
"react",
|
|
21
|
+
"ui-craft"
|
|
22
|
+
],
|
|
23
|
+
"author": "Pavanspoojary",
|
|
24
|
+
"license": "MIT"
|
|
25
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Annotations, guides and connecting lines
|
|
2
|
+
|
|
3
|
+
An annotation explains one relationship: what a chart point means, how big a selection is, where an event went, which object a note belongs to. The product stays visible. A line earns its place by removing ambiguity; it is not a reason to add a spotlight, another frame or a caption to every object.
|
|
4
|
+
|
|
5
|
+
Design the product before its annotations. A line that attaches perfectly cannot rescue faint text, weak hierarchy or generic nested cards. Give the table, invoice or record believable anatomy, readable type and one clear action, and save the stronger color for the relationship the line explains.
|
|
6
|
+
|
|
7
|
+
See `examples/annotations/`. Its picker mounts one of eight studies, so only the chosen story runs. The scenes use a native canvas width down to 288px instead of shrinking their labels, and each has a reduced-motion result.
|
|
8
|
+
|
|
9
|
+
| Study | Cause and result | Geometry owner |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Usage into an invoice | Three usage sources connect, deliver their first combined result, then the feeds stay open. | Each source is measured; one white-rimmed junction joins the inputs before the solid delivery. |
|
|
12
|
+
| A payout and its detail | Select a payout; its linked settlement opens; a leader explains its arrival; clearing closes the detail. | A dotted record link and a separate solid leader meet measured surface edges. |
|
|
13
|
+
| A chart point | Select a point; its explanation appears; click away to clear it. | Point and label are measured with `rect()`; their edges go to `Connector`. |
|
|
14
|
+
| Selection and dimensions | Select a card, resize it by its handle, drag back, deselect. | Card, ring and guides share one changing box, which shows its real dimensions. |
|
|
15
|
+
| A request and its reply | Send an event; the request draws; the acknowledgement returns after delivery; the trace clears. | Measured source and destination edges. Solid outbound arrow, dashed return. |
|
|
16
|
+
| Following a layer | Select a photograph; Arrange moves and resizes it; Reset returns it; click away to clear. | `Follow` owns the object and its note together. |
|
|
17
|
+
| A shared processing graph | Store an asset, fan out to three jobs, then clear the completed result. | One measured trunk and one shared spine; each branch starts at its own junction. |
|
|
18
|
+
| An ongoing event stream | Connect a checkout source; events keep arriving in its activity table. | A static measured route under moving dots; the path never moves. |
|
|
19
|
+
|
|
20
|
+
## Choose a line for a relationship
|
|
21
|
+
|
|
22
|
+
Start with the product question, then choose the line. If the layout already makes the relationship obvious, leave the line out. More connections do not make a fuller explanation.
|
|
23
|
+
|
|
24
|
+
Give related surfaces different jobs and different weight: the invoice leads and a smaller usage table sits in front of its empty upper corner; the selected ledger row stays readable beside a smaller settlement detail. Overlap can tie a composition together, but it never covers record text or forces a line through useful content. At narrow widths, stack the relationship rather than shrinking its type.
|
|
25
|
+
|
|
26
|
+
- **A leader explains a visible object or value.** One selected point joined to one short note, usually with no arrow and no continuing motion. Keep the note out of useful content and remove it with the selection.
|
|
27
|
+
- **A leader is a fine line with two clear ends.** 1px (1.5px at hero scale) in a quiet ink, never a bar. It leaves the note's edge and lands 4 to 6px short of the object it explains, ending in a 4px dot or at the object's edge with a gap, never butting into or crossing a rounded border. It runs straight or with one bend; it does not pass behind or through another surface (`examples/annotations`).
|
|
28
|
+
- **A record link joins two views of the same thing.** One row opens its settlement, and a fine dotted link makes that explicit. The quieter solid leader below explains arrival. Different jobs, different weights.
|
|
29
|
+
- **A collection joins several inputs to one result.** Three meter rows gather into one invoice. One blue runs through the incoming paths, their junction and the shared output, because they are one relationship; the small junction is the aggregation. Draw each incoming route once, and start the delivery only after every input has arrived. Never add a junction to fill space.
|
|
30
|
+
- **Direction shows transfer.** A request, an acknowledgement or a posted result needs an unambiguous origin and destination. A request and its response start from different ends, so the return arrow starts at the recipient; a decorative two-headed line cannot say that. Reveal the route before confirming arrival, and change the status after the transfer, not before the line has landed. A stationary arrow can stay afterwards.
|
|
31
|
+
- **A moving phase shows ongoing work.** Dots move only while data is flowing: fine, slow enough to follow, on a fixed route with only the phase animated. Never on a finished one-off request. Stop or freeze them when the connection closes, pause them offscreen and with the host, and keep a static directional poster under reduced motion. A finished invoice update can sit beside an ongoing feed: its first values have landed while new usage still travels the retained routes.
|
|
32
|
+
|
|
33
|
+
A small white pill with a fine rim and a tight shadow makes a job or service read as a node. In the processing graph each pill holds the job name and, where there is room, its arriving check; the narrow layout keeps the text alone and marks completion through the pill's ink and rim instead of squeezing in an icon. The source stays a file row with its filename, metadata and action. A node is part of the system being explained; annotation text is the explanation attached to it. Don't turn every label and endpoint into the same pill, and measure the pill's visible edge when connecting to it.
|
|
34
|
+
|
|
35
|
+
Center the pill's visible content as one group. A hidden status icon reserves neither width nor gap: the name alone is centered before the result, then the slot and gap open while the label moves with them, so the group stays centered throughout. Reverse that on removal.
|
|
36
|
+
|
|
37
|
+
A short inline badge can name the line itself: `POST`, `200 OK`, a protocol, a step. A slightly heavier label and a small shadow keep it legible over the stroke. It arrives with the completed line and keeps its footprint small; it is neither an endpoint nor a product surface.
|
|
38
|
+
|
|
39
|
+
A saturated blue dotted line is a deliberate, legible treatment; purple or teal can suit another study. One relationship, one color, rather than a hue per joined input. Color need not be pale to be restrained. The kit's default endpoint is a small colored center matching the route, a white rim and a subtle shadow, which marks a port or junction against a crossing line. Size it to the stroke and the display scale, treat it as a specific node rather than a decoration for every endpoint, and let it appear on arrival with its center on the route. A plain cap, a small arrow or no marker may be clearer elsewhere.
|
|
40
|
+
|
|
41
|
+
Keep four things separate: the route's geometry, the stroke pattern, the reveal along the route, and any continuing phase. A reveal mask lets a dotted line draw progressively without stretching its dots, and the phase never moves the route or the attached content.
|
|
42
|
+
|
|
43
|
+
## Attach to what is drawn
|
|
44
|
+
|
|
45
|
+
`Connector` takes points in stage pixels. Derive them from named targets, never from positions guessed off a screenshot. Attach to the edge that faces the relationship, with room for the line and its label, and keep the label out of the main content and other connectors. Horizontal and vertical compositions may need different endpoints.
|
|
46
|
+
|
|
47
|
+
Check the direction of the final segment, not just where it ends. A line meeting a label's bottom edge approaches vertically; one meeting its side approaches horizontally. An endpoint on the right border is still wrong if the segment before it runs along that border, underlines the label or crosses its interior. In the chart study, `route="h"` travels across first, then rises to the measured bottom center.
|
|
48
|
+
|
|
49
|
+
`rect()` refreshes after state commits and when a CSS transition finishes; it does not track CSS motion every frame. When something moves continuously, either update the scene's state each frame or put the object and its annotation in the same moving coordinate space. The following-layer study does the latter: its leader, note and outline are children of the same `Follow` wrapper as the object. A separate line aimed at Follow's destination would jump ahead of the visible layer.
|
|
50
|
+
|
|
51
|
+
`Follow` suits a selection ring retargeting between objects: it keeps its velocity while the target rect changes. Don't give the label its own spring if it must stay attached. For a drag, keep the grip offset and use `a.drag`'s per-frame point to size or move the object; read the displayed dimension from that same geometry, not from a number chosen in advance.
|
|
52
|
+
|
|
53
|
+
## Show the cause, then hold the explanation
|
|
54
|
+
|
|
55
|
+
Start the line when selection or delivery begins. `Connector` draws on and fades off intact; its arrow and label arrive with the line. A callout can fade in without moving its measured anchor. Hold the result long enough to read, and clear it with an on-screen action.
|
|
56
|
+
|
|
57
|
+
Endpoint markers wait for the visible route to reach them; `Connector` ties them to the reveal. A branching graph propagates from its incoming junction outward, starting each branch as its junction is reached, and a sender confirms delivery after the acknowledgement returns. Crossfade discrete statuses in stable `States` slots, start-aligned beside their status dots; a measured dimension tracks its box directly, in tabular numerals.
|
|
58
|
+
|
|
59
|
+
Line styles mean different things: a solid request and a dashed acknowledgement separate direction and role. A shared trunk means one input fans out, so draw the shared segment once, or the overlapping paths darken and knot.
|
|
60
|
+
|
|
61
|
+
## Frame the whole relationship
|
|
62
|
+
|
|
63
|
+
Leave room for the guide, arrowhead and label outside the target, clear of the product frame's clip. On a narrow host, stack the surfaces and move the labels with their lines, at their normal size. Chart marks may compress horizontally; their label stays readable. An annotation is not permission to cover the result it explains.
|
|
64
|
+
|
|
65
|
+
If a detail really needs a camera, use `Camera` with a focus from `a.rect(name, { layout: true })`, keep the annotation in the same coordinate space as its target, and never feed an already transformed rect back into the focus. These studies read without one.
|
|
66
|
+
|
|
67
|
+
## Check attachment in motion
|
|
68
|
+
|
|
69
|
+
Film `?capture=annotations`, choosing a study with `annotation=collect`, `detail`, `chart`, `measure`, `flow`, `follow`, `branch` or `stream`:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
node scripts/film.mjs '<url>/?capture=annotations&annotation=follow' --out shots/annotation-follow.png
|
|
73
|
+
node scripts/layout.mjs '<url>/?capture=annotations&annotation=measure' --select body
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Watch the entry, the held result, the exit and the return. During a resize, compare the guide ends with the card's edges on every sampled frame; during a follow, compare the leader's end with the object's edge, since a clean start and end can hide separation between them. Check the narrow width, and the picker, focus and Replay too. A contact sheet cannot prove continuous attachment or steady text: the gaps between samples are unchecked.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Backgrounds and the whole picture
|
|
2
|
+
|
|
3
|
+
The supplied looks are examples, not a menu of allowed styles. Start with the product and the feeling you want. A neutral interface, a saturated poster, a dark technical surface, a tactile control and an image-led composition can all work. Typography, content, layout, imagery, material and motion should all support the same idea; changing the accent color alone does not make a new identity.
|
|
4
|
+
|
|
5
|
+
## Choose the ground for what it does
|
|
6
|
+
|
|
7
|
+
- **Quiet solid or tint:** gives dense UI room to read. Separate the foreground with a clear step in value before adding a shadow.
|
|
8
|
+
- **Color field or graphic pattern:** makes a sparse picture distinctive. Keep a calm area behind useful text, and let the pattern give direction or scale. Crisp bands show what a glass surface blurs; a glow everywhere cannot.
|
|
9
|
+
- **Colorful gradient:** choose its direction and color relationships on purpose. A diagonal transition, a broad radial light, blended fields and a multicolor sweep are different compositions. Keep strong color behind an opaque surface, or give glass enough density to keep its text readable. A vivid ground does not also need vivid controls, a colored shadow and a glow.
|
|
10
|
+
- **Material:** paper, glass, metal and sculpted plastic need different edges, highlights and shadows. Use those cues consistently. Texture supports a material; it does not sit over text or stand in for hierarchy.
|
|
11
|
+
- **Photography or artwork:** use a suitable licensed local asset, keep its subject and credit it where required. A graphic illustration may be abstract, but never present a CSS landscape as a photograph. The graphic album sleeve in `examples/hero-grid/` is artwork on purpose.
|
|
12
|
+
- **Dark:** choose text, borders and raised surfaces together. Black behind a white mockup and a coherent dark product are different compositions; both can be intentional.
|
|
13
|
+
|
|
14
|
+
`examples/backgrounds/` holds the same small interface across twenty grounds, so you can compare tint, fields, light, linework, material, six vivid gradients and six textures (dot grid, halftone, blueprint, grain, conic sweep, fine stripes). The gradients vary their direction, value and material rather than repeating one glow in different colors. They are examples of relationships, not a preset selector.
|
|
15
|
+
|
|
16
|
+
Give banded grounds a hierarchy: a dominant field, a supporting color and an optional narrow highlight. Let glass show their tint while its text and controls stay readable. Band width and color area deserve the same composition judgment as the foreground.
|
|
17
|
+
|
|
18
|
+
## Compose the set before the tiles
|
|
19
|
+
|
|
20
|
+
The rules of the set (one hero, contrasting neighbors, grounds composed together, copy outside the picture) are `bento.md` rules 2, 4, 6 and 10. `examples/hero-grid/` shows them with several grounds: a drafting sheet, orange keycaps, violet-to-peach bands under glass, a neutral icon collection and a dark music player, held by shared 8px gaps and 12px corners. Orange returns in the artwork and violet links the glass to the dark sleeve: borrow the relationships, not the colors. Judge adjacent colors as a pair and the grid as a silhouette. An image-led hero can skip tile headlines when the pictures carry the idea.
|
|
21
|
+
|
|
22
|
+
## Objects and drawings as tiles
|
|
23
|
+
|
|
24
|
+
The tiles that stop a grid being five windows are rarely UI: a payment card lit from one side, a folded corner of paper, a chip, a keycap, a line drawing of a stack or a graph. Give an object one light source, a real material (a matte card has a soft falloff, a glass pane has a rim) and a shadow that agrees with the tiles around it. A line drawing uses one stroke weight and the grid's own ink, and holds still. Neither needs a label inside the picture; the tile copy does that.
|
|
25
|
+
|
|
26
|
+
A stack of objects is one object. Center the whole silhouette (every card in the fan, not the front one) with the same air on each side of the tile, and keep the back ones clear of the copy; a stack drifting up under the words reads as spilt. A payment card keeps its real anatomy at any size: the chip about an eighth of the card's width, a third of the way down, with the contactless arcs beside it at about half the chip's height; the name and number along the bottom edge, the network mark in the bottom-right corner. A chip the size of an icon on a card the size of a tile is the first thing that gives a drawn card away.
|
|
27
|
+
|
|
28
|
+
## Recompose for the host
|
|
29
|
+
|
|
30
|
+
Recomposition and motion follow `bento.md` rules 11, 12 and 13. In `examples/hero-grid/` the controls get a native compact layout, the glass and player go full width, the two small object collections share a row, and only the drafting tile has a story. A crop can take a blank keycap edge, album artwork or window margin, never the label or result the viewer needs.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Bento
|
|
2
|
+
|
|
3
|
+
A bento grid is one picture made of tiles, not five demos side by side. Most of its quality is decided before any tile is built: which tiles show UI at all, which one is the hero, and what sits next to what. A grid where every tile is a cropped window reads as generated however well each window is made.
|
|
4
|
+
|
|
5
|
+
These are starting recipes for mixed feature grids; the product, brief and content decide the final composition. Single-tile framing (crops, satellites, gutters) is in `framing.md`; this file is about the set.
|
|
6
|
+
|
|
7
|
+
## The rules
|
|
8
|
+
|
|
9
|
+
1. **Not every tile is UI.** About a third to a half of the tiles show product UI; the rest are other kinds (the table below). UI is the thing a bento is good at breaking up, not the thing it repeats.
|
|
10
|
+
2. **One hero.** One tile is bigger (two columns, or two rows) and carries the richest picture or the main idea. The rest support it at a smaller size: a wide UI tile spanning two thirds of a row, or an object or photograph leading a taller composition. Equal tiles need a clear difference in content and weight.
|
|
11
|
+
3. **A UI tile shows one thing, not a window.** Crop to the single component the tile is about (the button, the status stepper, the fee picker, the command row) and show it at real size or larger, so a third of the tile can be one control. Window chrome appears at most once in a grid, on the hero; four sets of traffic lights in one grid is four times the same signal.
|
|
12
|
+
4. **Neighbors contrast.** Alternate kinds like a checkerboard, across and down: a picture next to a number, dense next to calm, a photo next to an icon and a sentence. Two window crops never sit side by side. Vary density and silhouette across rows and columns so the eye has a clear path.
|
|
13
|
+
5. **Big type is a tile.** A stat tile is one real number at display size (48 to 72px as shown), a short lead ("Up to"), a one-line label, and at most one colored glyph such as a bolt or battery. A short statement in large type ("99.99% uptime", "More ports and faster charging.") is a tile too. These are the calm tiles that let the UI tiles breathe. Real figures, never "10x" filler. The number sits close under its copy or fills the tile; a stat pinned to the bottom of a tall tile with a void above it reads as missing content, not calm.
|
|
14
|
+
6. **Copy is short and outside the picture.** A title of one to four words, or one sentence; at most one supporting sentence; never a paragraph or a bullet list. Two patterns work: the run-in, a bold lead and a gray continuation at the same size ("**Stay in sync.** Your files stay up to date."), or a large title alone. Tile copy is page type: 17 to 24px, set by the page, never the 12px of the UI inside the tile. A 15px title scaled to 10px is a caption, not a headline.
|
|
15
|
+
7. **One frame, varied contents.** Tiles share radius, gap, padding and where the copy sits (all top or all bottom); the variety lives inside them, and grounds and materials may differ when the composition calls for it. Pick one family: rounded tiles on a gap, or a ruled grid with no gap and fine lines between cells. The gap equals the tiles' inner padding or a clear fraction of it. Judge the outside too: a grid on its own ground usually wants an even outer gutter, and a page that already gives that space shouldn't double it. A crop inside one tile is no reason to press the whole grid against its frame. Align left-led UI and diagrams to the copy gutter with one gap below the copy; don't center each by habit. A centered object is its own deliberate composition.
|
|
16
|
+
8. **Use the tile edge deliberately.** The outer tile owns the bleed. An inner fixed-width Stage must not slice a window halfway across a wider tile and leave a blank strip beside it: measure the picture slot and match its width at every breakpoint, compact included, and inspect the right and bottom edges at the host's width. `scripts/layout.mjs` reports this as `nested-composition-crop`; look at the image and fix any unintended inner cut. A window or phone can enter from an edge and crop supporting content, as in `framing.md`, with its action and payoff whole. A UI fragment without chrome can dissolve into the tile ground; a solid window crops at a clear boundary. A centered object, lone control or statistic can be shown complete when its scale and the space around it are intentional. The boxed failure is shrinking a whole screen until its contents are unreadable, not leaving a margin.
|
|
17
|
+
9. **Say each thing once across the set.** No real string, avatar, color mark or chrome repeats from tile to tile. One conversation threaded through five tiles ("Refund for order #4821" three times) is the same signal repeated, not a story.
|
|
18
|
+
10. **Compose the grounds together.** A quiet feature grid can share one surface, with one photo, accent or inverted tile as punctuation. That is a starting recipe, not a limit: an expressive hero grid can use several grounds when their lightness, temperature and saturation make a rhythm. Keep neighbors distinct, give one tile the lead, and don't repeat the same gradient or spend every accent everywhere. See `backgrounds.md` and `examples/hero-grid/` for a multicolor composition.
|
|
19
|
+
11. **Give motion one place to lead.** In a supporting feature grid a tile does one small thing: a number ticks, a dot grid changes, a bar fills, a button settles into its pressed state. It plays once as the grid scrolls in, staggered 80 to 120ms across tiles in reading order, or on hover for that tile alone. A hero grid can give its lead tile a short cursor story while the others hold still, as in `examples/hero-grid/`. Several competing loops leave the eye nowhere to land.
|
|
20
|
+
12. **Shown at 1:1, one Stage per tile.** Each picture is its own `Stage`; the copy is page HTML beside it, never inside the stage. Never wrap the whole grid in one Stage: it scales every tile's type down with the grid (a 1000px grid in a 630px column draws 15px titles at 9.5px). Tiles change width as the grid reflows, so measure the picture slot, use that native width for a bleeding Stage, and recompose its contents for compact slots. Text stays at native size; changing a Stage's width is not a scale transform, and a host wrapper marked `data-ss-wide` scales the wide design only for a slot sized by height. Pin a deliberate crop to the tile edge. A centered object can keep a fixed design canvas when its inner boundary cuts only empty ground. `examples/bento/` uses both patterns.
|
|
21
|
+
13. **Narrow, it recomposes.** Keep two columns only while each tile stays readable and deliberately framed: an article column around 550px may hold two, a phone column usually stacks, hero first. Pick the breakpoint from the content, not a universal screen width. Each UI picture gets a compact composition when it no longer fits; type tiles reflow by themselves. Important text stays at least 10px at a 320px host, gutters included.
|
|
22
|
+
14. **A stat is one line.** The number and its unit sit together and never wrap: size the number to the tile with the unit on (`white-space: nowrap`), or move the unit into the lead line ("Works at 30,000 ft" becomes a lead of "Works at" and a number of "30,000 ft" that fits). The film names it `unit wrapped:`.
|
|
23
|
+
|
|
24
|
+
## Kinds of tile
|
|
25
|
+
|
|
26
|
+
| Kind | What it holds | Example |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| **One component** | A single control or panel at real size or larger, cropped by the tile | A backup control, keycaps or locale list |
|
|
29
|
+
| **Hero UI** | The one tile with a real screen: window or phone, cropped per `framing.md` | Checkout or a conversation |
|
|
30
|
+
| **Stat** | One big number, a lead, a label, maybe one colored glyph | Battery life, charging progress or measured uptime |
|
|
31
|
+
| **Statement** | One sentence in large type, an icon in color beside or above | A short claim about connectivity or speed |
|
|
32
|
+
| **Object** | A product, a card, a chip, an isometric drawing | A payment card, processor or physical control |
|
|
33
|
+
| **Diagram** | An abstract picture of what the feature does: a grid, a heatmap, nodes and lines | A heatmap, sync relationship or shared canvas |
|
|
34
|
+
| **Collection** | Logos, app icons, file tiles, emoji: many small marks, bleeding off | Integration marks, file thumbnails or emoji |
|
|
35
|
+
| **Photo** | A real photo, with type over its quiet part. Never a scene drawn in SVG or CSS to stand in for one: however much grain and haze it gets, a drawn "photo" reads as generated. With no licensed photo to hand, pick another kind. A landscape photo rarely fits a tall tile with copy on top: it ends up a sliver, or the horizon crowds the headline. An illustration in its place is either purely graphic (a pattern, a motif from the place, like azulejo tiles for Portugal) or drawn in smooth, continuous curves, never lumpy or faceted, and it holds still | A licensed product or lifestyle photograph |
|
|
36
|
+
|
|
37
|
+
A grid of five usually wants one hero UI, one or two components, one stat or statement, and one object, diagram or collection.
|
|
38
|
+
|
|
39
|
+
## Layouts
|
|
40
|
+
|
|
41
|
+
| Layout | Shape | Use for |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| **Hero and strip** | A row of 2/3 + 1/3, then three equal tiles | The default for five or six features |
|
|
44
|
+
| **Staggered pair** | Two columns, tall and short tiles alternating, offset between columns | Four to six claims with photos |
|
|
45
|
+
| **Even grid** | 3 × 2 equal tiles | Only when every neighbor is a different kind |
|
|
46
|
+
| **Big square** | Four columns, a 2 × 2 hero, small tiles round it | Many products, one flagship |
|
|
47
|
+
| **Ruled** | One rounded container, 1px rules, no gaps, mixed spans | Technical or developer pages |
|
|
48
|
+
|
|
49
|
+
**Every width is its own design.** Check the grid at each width it will meet, down to an article column (about 550, so half tiles near 270). Two columns work there when each picture has been composed for its narrower tile; stack when the content needs more width. At each width every picture lines up with its tile's copy: left edge on the copy's gutter, and a matching gutter on the right or a clear crop off the right or bottom. Never center a picture about as wide as the tile, so it touches both edges or loses a few pixels to each; resize it, re-lay it out or swap the card for that width.
|
|
50
|
+
|
|
51
|
+
## Planning a grid
|
|
52
|
+
|
|
53
|
+
Write the tile list before building anything:
|
|
54
|
+
|
|
55
|
+
| Tile | Span | Kind | The one thing | Words |
|
|
56
|
+
|---|---|---|---|---|
|
|
57
|
+
| Inbox | 2 × 1 | Hero UI | One conversation arriving, selected | "Shared inbox" + one sentence |
|
|
58
|
+
| SLAs | 1 × 1 | Stat | "14m" left, in the warning color | "Never miss a reply." |
|
|
59
|
+
| Assign | 1 × 1 | Component | The assignee menu, Maya checked | "Assignments" |
|
|
60
|
+
| AI drafts | 1 × 2 | Component | The draft reply and its Send button | "Drafts that sound like you." |
|
|
61
|
+
| Integrations | 1 × 1 | Collection | App marks bleeding off the right | "Works with your tools." |
|
|
62
|
+
|
|
63
|
+
Then check the plan against rules 1, 2, 3, 4 and 9: how many tiles are UI, which is the hero, does any tile sit next to the same kind, does any real string appear twice. Inspect the built grid and each crop at the widest and narrowest host; a good tile can still be the wrong neighbor. The still questions are in `verify.md`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Brand marks
|
|
2
|
+
|
|
3
|
+
Use current real artwork when a scene shows a known product or payment method. Check the official brand source before trusting a third-party icon catalog: catalogs keep outdated colors and logos. `BrandMark` has a small local registry for common integrations and checkout rows. The SVGs ship with the kit, keep their original colors and proportions, and never call an icon service at runtime.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { BrandMark } from './kit'
|
|
7
|
+
|
|
8
|
+
<BrandMark brand="google-calendar" size={28} />
|
|
9
|
+
<BrandMark brand="visa" size={20} tile={false} />
|
|
10
|
+
<BrandMark name="Your product" src="/assets/product.svg" size={28} />
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`size` is the footprint's height. App marks get a square footprint; wide payment marks get a proportionate width. Amex uses its white wordmark on a blue card tile, and its official blue-box logo when bare. A mark that ships as a glyph on a solid square field (Dropbox) is shown as the glyph alone in its brand color, on the same white tile as the other app marks; a sharp blue square inside a rounded white one is never right, and a solid blue tile shouts next to the rest of the row. `width` overrides the footprint when a product row has a fixed track. The artwork is always `object-fit: contain`, never stretched to fill a square. The bundled marks carry optical scale adjustments, so a narrow Figma mark and a full Gmail mark have the same presence.
|
|
14
|
+
|
|
15
|
+
`surface` follows the Stage's light or dark theme. Pass `surface="light"` for a white card inside a dark Stage. Dark variants are picked automatically where supplied; full-color artwork without one keeps a white tile on a dark surface. If you remove the tile, check the bare mark against its real background. Keep the native colors even in a monochrome UI. Crypto marks are flat, with no coin bevels or metallic shading.
|
|
16
|
+
|
|
17
|
+
`name` overrides the accessible label. A custom `name` with no artwork keeps the neutral initial tile for a fictional product; never use an initial or a hand-drawn approximation in place of a supplied real mark. Minimal fidelity hides the artwork along with the other content.
|
|
18
|
+
|
|
19
|
+
A real company named in the scene (Chase, Wells Fargo, Stripe, Slack) carries its real mark from `kit/brands/`, never an initial in a brand-colored tile: that is an invented logo beside a real name, and film flags `invented mark`. The kit carries the payment networks, the common product marks and seven banks (Chase, Wells Fargo, Bank of America, Barclays, HSBC, Monzo, Revolut, in `kit/brands/`, category Banks). If the kit has no mark for the company, name one it has, or a fictional one with the neutral initial tile; a real name and a fake mark together are the one thing never shipped.
|
|
20
|
+
|
|
21
|
+
| Group | `brand` values |
|
|
22
|
+
|---|---|
|
|
23
|
+
| Payments | `visa`, `mastercard`, `amex`, `discover`, `paypal`, `stripe` |
|
|
24
|
+
| Crypto | `bitcoin`, `ethereum`, `solana`, `usdc`, `tether` |
|
|
25
|
+
| Banks | `chase`, `wellsfargo`, `bankofamerica`, `barclays`, `hsbc`, `monzo`, `revolut` |
|
|
26
|
+
| Apps | `notion`, `gmail`, `google-calendar`, `google-docs`, `1password`, `figma`, `slack`, `github`, `linear`, `dropbox`, `google-drive`, `google-sheets`, `google-slides`, `google-meet`, `zoom`, `vercel`, `shopify` |
|
|
27
|
+
|
|
28
|
+
Use only the integrations or payment methods the scene needs. A small row explains a relationship; it does not fill spare space with logos. Keep equal row tracks and align the marks by eye: their different silhouettes are no excuse for ragged labels or uneven gaps.
|
|
29
|
+
|
|
30
|
+
`examples/brand-marks/` shows every bundled mark on light and dark surfaces. `brandMarks` and `BrandName` are exported for a typed picker or registry lookup. `kit/brands/SOURCES.md` has the pinned artwork sources and licenses.
|
|
31
|
+
|
|
32
|
+
Inspect the rendered artwork, not just its image box. Tall marks need real air above and below; wide marks must show in full. Give the image a definite box inside a centered flex layout: percentage image dimensions in an intrinsic grid track can grow unexpectedly and leave uneven insets. Check the real light and dark backgrounds, not just their theme attributes.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Choreography
|
|
2
|
+
|
|
3
|
+
Start with a readable still and a short account of the change. Name the frame that holds still, the state that starts things, the responses that depend on it, the destination and the hold. Pick timing only once those relationships are clear. A quiet frame gives the moving parts something to move against; moving every layer at once takes that away.
|
|
4
|
+
|
|
5
|
+
## A change passing through an interface
|
|
6
|
+
|
|
7
|
+
Keep the header, outer surface and action positions steady while the variable content changes inside them. A setting can lead its dependent amount, payment method and form. Start the dependent movements before the previous ones finish, with offsets that make the order legible. Keep the old and new content in tracks rather than replacing the whole screen.
|
|
8
|
+
|
|
9
|
+
Use a fixed, local soft mask where a track enters and leaves. Its settled text sits wholly inside the opaque part, and the control's border stays outside the mask. Don't soften the whole interface, blur every transition or use a mask to hide bad resting geometry. A row changing height needs something else: fade its content while its space opens or closes, so the moving edge never slices readable ink.
|
|
10
|
+
|
|
11
|
+
`examples/choreography/` shows a cursorless checkout changing market. Its frame and product stay put while the currency, price, method and address respond. The comparison beside it uses the same layout and movement with every start at once, so timing is the only variable. Read it as one possible sequence, not a required checkout style or timing preset.
|
|
12
|
+
|
|
13
|
+
## Timing has different jobs
|
|
14
|
+
|
|
15
|
+
| Job | Decision |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| Direct feedback | Start on the input; a presentation delay feels unresponsive. |
|
|
18
|
+
| Travel between stable positions | A departure, a stretch of clear travel and a soft arrival. Length alone does not make it fluid. |
|
|
19
|
+
| Related data updates | Recognition, transfer and the accumulated result can each take a different time. The result still follows its cause. |
|
|
20
|
+
| Introducing a composition | A small front-loaded movement can settle for longer than its busy part. Don't scale readable text much. |
|
|
21
|
+
| Replacing content | Keep the container, alignment and reading interval; mask only the moving slot. |
|
|
22
|
+
| Holding a result | Stop. A useful still needs no new pulse or repeated count. |
|
|
23
|
+
|
|
24
|
+
## Choose the curve for the movement
|
|
25
|
+
|
|
26
|
+
A slow departure, concentrated travel and soft arrival make a retained content track readable. A direct press needs quicker feedback. A number accumulating after a transfer may take longer than the transfer itself. Choose these together: one duration or easing applied everywhere flattens the hierarchy.
|
|
27
|
+
|
|
28
|
+
A small expressive icon may overshoot while its card and text settle without bounce; keep that accent local. Keep useful content through a form change, and give the final state time to read. In a code demo, use real syntax-highlighted code with sans-serif labels and copy: monospace belongs to the code, not the whole scene.
|
|
29
|
+
|
|
30
|
+
## Review the full change
|
|
31
|
+
|
|
32
|
+
Watch at normal speed, then step through the onset, the overlap, the masks, the final cleanup and the hold. Check text pixels as well as geometry: a stable rectangle can still hide glyph shimmer. Check the narrow host, reduced motion, pause, step, replay and the return from offscreen. A paused new scene must finish its first measurements without advancing the story. If pacing looks uneven, compare independent RAF samples with elapsed time; a smooth virtual-clock export says nothing about live playback.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Craft
|
|
2
|
+
|
|
3
|
+
The rules for the still frame. Framing is in `framing.md`; everything that moves is in `motion.md`.
|
|
4
|
+
|
|
5
|
+
Index: [Restraint](#restraint), [Type](#type), [Spacing and alignment](#spacing-and-alignment), [Icons and logos](#icons-and-logos), [Color and looks](#color-and-looks), [Density](#density), [Chrome and devices](#chrome-and-devices), [A page of demos](#a-page-of-demos), [Recipes](#recipes).
|
|
6
|
+
|
|
7
|
+
## Restraint
|
|
8
|
+
|
|
9
|
+
- **Count the real strings:** the title, the thing acted on, what is typed, the result; usually 3 to 7. The rest is `Bar`.
|
|
10
|
+
- **A word budget is not an element budget.** A calendar needs a populated week, a search a collection, a filter enough rows.
|
|
11
|
+
- **Lists are made of `Row`;** hand-built rows are where lists go wrong (`examples/gmail`).
|
|
12
|
+
- **Bars are the product's filler; the subject is words.** Bars where the eye lands read unfinished (`examples/spotify`).
|
|
13
|
+
- **In a still the subject is real,** words and values; a sidebar or list of bars beside it is filler and fine.
|
|
14
|
+
- **Where the story touches a list,** two or three real rows and at most as many bars. Film flags `skeleton ladder` at realistic fidelity only.
|
|
15
|
+
- **In a small surface a row is one line:** in a popover, a card or a tile, avatar, name, value. No gray bar under a real name there; filler beside real words reads as noise.
|
|
16
|
+
- **Named avatars take their own color** (the kit default); gray discs are filler only.
|
|
17
|
+
- **Label and value match:** both words or both bars. A blank pill beside a real control is dead; leave it out.
|
|
18
|
+
- **Keep the domain's signature content:** album art, thumbnails, avatars; swapped for the feature's signal it is a generic list (`examples/dark-bento`).
|
|
19
|
+
- **When the output is the subject** (a log, a diff, a terminal), real lines are the content: short and few, the rest of the screen quiet.
|
|
20
|
+
- **A terminal is a character grid:** a spinner and a text tick share one `1ch` cell; each line owns its mark, swapped in place (a tick on its own line in `examples/ruled-bento`).
|
|
21
|
+
- **One number gets to be big;** the rest are lines (`examples/subscriptions`).
|
|
22
|
+
- **Placeholder widths vary** row to row (60, 45, 70, 52).
|
|
23
|
+
- **A date-range band runs week by week** with air between rows, fades where the range continues, and is capped only on the real start and end days, each a solid disc (a circle, not a rounded square) in the accent with the day in white.
|
|
24
|
+
- **Say it once.** One clear link for the feature, not its signal in header, satellite and every row; a second confirmation only when it differs (`examples/dark-bento`).
|
|
25
|
+
- **No masthead for a fictional name:** no monogram, logo, sidebar and nav in every crop; a real mark only when recognition needs it.
|
|
26
|
+
- **The product's name appears only when the brief leans on it** and the real product would show it there: a notification's app name, the app's own title bar. A brief that just names the product doesn't need it on screen; the page around the demo already says it.
|
|
27
|
+
- **Simplify before polishing:** the fewest surfaces and strings that explain the product, then borders and badges only where earned.
|
|
28
|
+
- **Simplification keeps the character.** Cut repeated framing before meaningful imagery; an empty white card is not the cure.
|
|
29
|
+
- **Judge the silhouette before the details.** At thumbnail size the subject, support and empty space make one picture.
|
|
30
|
+
- **Compose objects, not an inventory of cards:** hierarchy from proportion, space, material and ground, not more boxes (`examples/story`).
|
|
31
|
+
- **The heaviest marks sit on what the story is about;** never a 2px black underline under a gray bar.
|
|
32
|
+
- **Space follows the story.** The payoff gets the room; no empty band mid-window while the result is pushed into the crop. No gap above a card, no cream under a phone's last row, no void between a stat's label and its number.
|
|
33
|
+
- **Dots, halos, badges and focus rings sit fully inside the content edge.**
|
|
34
|
+
- **Check imagery at its smallest size and over every surface it crosses;** a pale thumbnail can look see-through.
|
|
35
|
+
- **A specimen still describes one plausible app:** title, toolbar, navigation and body agree.
|
|
36
|
+
- **Nothing outsized.** The hero element sits in proportion to a real screen.
|
|
37
|
+
- **Realism is the developer's call.** At `fidelity="realistic"` or when asked, plausible content everywhere, still with room to breathe (`examples/wikipedia`).
|
|
38
|
+
- **Character is real too.** A styled brief gets its colors, radii, mascot and motion in full, still a shippable product under these rules.
|
|
39
|
+
|
|
40
|
+
## Type
|
|
41
|
+
|
|
42
|
+
- **Fit the text before fixing the box.** A control's border-box holds content, padding and border; flex centering does not make it fit.
|
|
43
|
+
- **Small text gets a line height of at least 1.3** and insets on every side; check the text slot's own clearance.
|
|
44
|
+
- **Real sizes, then scale:** 11 to 15px UI text, scaled by the stage; never 7px type.
|
|
45
|
+
- **One family:** the product's or the system stack. Monospace only for code, identifiers and aligned numbers, never a technical product's labels (`examples/ruled-bento`).
|
|
46
|
+
- **Keep only the text needed** to recognize the product and follow the beat; extra logs and timestamps are noise.
|
|
47
|
+
- **Sentence case** unless the real product has caps; hierarchy from spacing and one weight step.
|
|
48
|
+
- **No real headings.** A faux app's title is a `div`, never `h1` to `h6`: the demo lives in someone's page outline.
|
|
49
|
+
|
|
50
|
+
## Spacing and alignment
|
|
51
|
+
|
|
52
|
+
- **A button keeps 8 to 12px from the field, line or card edge above it;** sitting on the field it reads as touching (film flags `tight control`), and much more lets it drift off from the field it belongs to. A floating card (a comment popup, a toast) pads the same all round, measured to the avatar's and button's edges, not their words: 20px above the name with 14px at the side reads as a miss. A composer's Post or Send sits close under its box; padding sized for the posted card goes on the card, not between box and button.
|
|
53
|
+
- **Words keep a 12px inset** from the edge of a window, card, panel or hovered row; film flags `tight inset` under 8px. Bars may bleed, words do not.
|
|
54
|
+
- **Row padding is 12px,** 8px for a dense list; a one-line row three times taller than its words is a `fat row`.
|
|
55
|
+
- **A title over its subtitle reads as one item:** 4 to 6px of ink between the lines, a 1.3 line height plus a 2px gap. The air comes from the row's padding (`examples/gmail`).
|
|
56
|
+
- **Bars sit in the same line box as the text they replace,** so a skeleton row keeps the real row's pitch.
|
|
57
|
+
- **Bars keep their lines' white space, not line pitch:** 6 and 5px bars want 7px between; a trailing time sits on line one.
|
|
58
|
+
- **Text never touches a neighboring box:** a fixed `gap` of 8 to 12px, never leftover `space-between` (`touching`).
|
|
59
|
+
- **A placeholder bar follows the text rules:** it never touches or runs under an avatar, badge, icon or bar.
|
|
60
|
+
- **Center a label on its letters, not its line box.** Capitals sit low in a plain line box, so a label beside an icon (a check and "Sent" in a button), in a pill, or an initial in a disc reads low. Trim the label: `text-box: trim-both cap alphabetic` (the kit's `Badge` and `Avatar` already do).
|
|
61
|
+
- **Nested shapes pad evenly** (a pill inside a field, an icon inside a button: the same distance from every edge), and the outer radius equals the inner radius plus that padding.
|
|
62
|
+
- **Carry the inset round the bottom;** a comfortable top does not excuse a cramped action.
|
|
63
|
+
- **Content clears the bar above it:** a page's first heading sits at least the content's side inset below a toolbar or title bar's rule, never just under it.
|
|
64
|
+
- **Whitespace groups:** a title sits closer to its metadata than to the next record; never spread lines equally to fill a frame.
|
|
65
|
+
- **Align the reading edge, then the visible ink.** A small icon aligns with the title's first line; size each lane before nudging.
|
|
66
|
+
- **Center on the visible face.** Take tracking back with a negative `margin-right`; a pair centers as a pair.
|
|
67
|
+
- **Field text centers cap height to baseline** (`text-box: trim-both cap alphabetic`), as the kit's `Field` does (`examples/controls`).
|
|
68
|
+
- **A popup under a field draws its ring inset** so its sides line up with the field's.
|
|
69
|
+
- **A control hugs its content;** never `flex: 1` with its contents at one end (`lopsided`).
|
|
70
|
+
- **Fix overflow by fitting the content,** not by widening the container; re-measure padding after (`uneven`).
|
|
71
|
+
- **Columns line up:** every row shares one grid template with fixed tracks; optional content keeps its track empty; bars vary inside their track.
|
|
72
|
+
- **A dot, badge or ring is not a column:** in the gutter or on the avatar, 6px clear, inside the row's inset (`tight mark`, `examples/gmail`).
|
|
73
|
+
- **No near-tangents.** Edges 1 to 3px apart read as an accident: line them up exactly, or part them by at least the gutter and never under 8px.
|
|
74
|
+
- **Don't end just short of an edge:** real room, or move it down and crop it (`framing.md`, rule 11).
|
|
75
|
+
- **A centered amount centers its digits;** `$45` centered as one string sits right of center to the eye. The currency sign hangs off the left, outside the centering: the digits are the centered box and the sign is absolutely placed at `right: 100%` inside it. A rolling amount rolls only the digits.
|
|
76
|
+
- **Links have no hover surface;** a control gets a surface visible at rest.
|
|
77
|
+
- **Hover and selection fills are inset and rounded;** negative margins go on the list, not the row; copy a real product's square fills (`examples/wikipedia`).
|
|
78
|
+
- **Clone a real product's menu from its computed styles** (`examples/wikipedia`).
|
|
79
|
+
- **A trigger with its popover open keeps its pressed look:** `data-open`, styled like `[data-hover]` (`examples/hero-demo`).
|
|
80
|
+
|
|
81
|
+
- **A progress ring is one track and one arc,** round caps, never butt-capped dashes chopped into segments; a week of days goes in the dots beside it. A number in a ring centers on its digits: `Roll` with proportional figures, not `Count`, whose fixed-width digits leave a 1 off center; trim it to cap height (`text-box: trim-both cap alphabetic`) and set an icon above it apart, so the figure the eye lands on is the ring's center, not the pair's box.
|
|
82
|
+
|
|
83
|
+
## Icons and logos
|
|
84
|
+
|
|
85
|
+
- **Imagery earns its place:** real imagery or a good icon, never invented illustration; gray art only for empty states.
|
|
86
|
+
- **Icons come from a set, never from your hand.** The product's own pack first (its dependencies, icons folder, sprite or `Icon` component); otherwise a set chosen on purpose (below), used at one size and one stroke width throughout. A glyph drawn by hand is the first tell of generated UI: its weight never matches its neighbors (film flags `mixed icons`).
|
|
87
|
+
- **No hand-drawn marks** (pin, cursor, badge, ringed dot, chip, contactless arcs): from the kit or the product's assets, else leave them out.
|
|
88
|
+
- **A drawn mark gets a close-up beside the real thing,** seen as a stranger would.
|
|
89
|
+
- **Otherwise choose a set on purpose:** kit `Icon filled` for Apple, Material Symbols for Android, else Phosphor, Iconoir, Radix, Tabler or Heroicons; Lucide deliberately, never reflexively.
|
|
90
|
+
- **Apple chrome uses SF-style glyphs;** a Lucide glyph only where no system glyph exists, as `examples/finder` does.
|
|
91
|
+
- **One family, one stroke weight, one size** (14 to 16px) per scene; equal boxes can still hide a heavy fill beside a thin outline.
|
|
92
|
+
- **Even glyphs in even boxes;** an odd icon in an even box snaps when motion ends (`half-pixel glyph`).
|
|
93
|
+
- **Fixed boxes don't shrink:** an icon button or chip in a flex row gets `flex: none` (`squeezed`).
|
|
94
|
+
- **Small icons are filled.** At 14px and under, and in tinted tiles, use the filled style; thin outlines go wiry (`examples/kit-extras`).
|
|
95
|
+
- **Icons are one opaque color** (`--ss-icon`, `--ss-icon-faint`, opaque text tokens); fade with `opacity` on the svg; no duotone.
|
|
96
|
+
- **Emoji are content, never icons.** A playful look rounds the icons, it does not swap them for emoji (`emoji icon`).
|
|
97
|
+
- **Other products' logos come from `BrandMark`** or a project asset, in original proportions and colors; never a look-alike (`brands.md`).
|
|
98
|
+
- **Center glyphs by eye:** shift a play triangle toward its point by a sixth of its width.
|
|
99
|
+
- **AI features get no sparkle, wand or star, and no purple as the AI color.** Show what the AI does. The product's own icon is fine even when it is a sparkle (`examples/hero-demo` uses its product's `list-sparkle`); a sparkle as generic AI decoration is not.
|
|
100
|
+
- **No invented logo.** A letter or glyph in a colored square is not the product's mark (film flags `invented mark`). Use the product's real mark, or a plain text wordmark.
|
|
101
|
+
|
|
102
|
+
## Color and looks
|
|
103
|
+
|
|
104
|
+
- **One neutral family** for window, sidebar and cards; a colored ground or another material differs on purpose.
|
|
105
|
+
- **Five inks and one accent** to start; status colors mean status; an expressive product may need more, with a clear hierarchy.
|
|
106
|
+
- **No redundant tonal borders.** Try the fill alone; add the border for separation, state, or because the product draws it.
|
|
107
|
+
- **Quiet is not faint:** check text, actions and surface against the real ground.
|
|
108
|
+
- **A gradient or glow serves the story or goes.**
|
|
109
|
+
- **The hero isn't outlined to point at it.** An accent ring with a soft halo around the card the story is about reads as a focus state nobody gave it, and a dot beside its label is a mark with no meaning. Lift it the way the product would: its own surface, the raised shadow, a label in the accent. A ring is for a field that really has focus.
|
|
110
|
+
- **A filled button keeps its color under the pointer:** one step of its own color, never a gray swap; success is the one real change.
|
|
111
|
+
- **In mono, mark the thing acted on with a solid step** in surface and weight, never a translucent wash (`examples/dark-bento`).
|
|
112
|
+
- **Nothing translucent overlaps.** Overlapping avatars are `Facepile`; stacked chips or cards take opaque fills (`onion skin`, `examples/figma`).
|
|
113
|
+
- **On dark themes depth comes from a lighter surface,** not shadow; satellites go on `--ss-raised` (`examples/linear`).
|
|
114
|
+
- **A light document over a dark workspace stays a readable light document** with its own foreground and edge.
|
|
115
|
+
- **The light inks are tuned for white cards on gray canvas;** on white, step them up a tone.
|
|
116
|
+
- **Status color stays legible:** success, pending and disabled distinct, never passing through mud.
|
|
117
|
+
- **Contrast has a purpose.** A dark editor can be identity with a clear edge; a near-black strip for no reason is a hole.
|
|
118
|
+
- **Grounds support the subject;** a muddy halo standing in for foreground contrast does not (`backgrounds.md`).
|
|
119
|
+
- **Build once, check every look:** `theme` (light, dark, blueprint, glass), `palette` (accent, mono), `fidelity` (minimal, standard, realistic); `Text` for words, tokens for color.
|
|
120
|
+
- **A light pass does not prove dark.** Film every look the request names; `--dark` films the dark theme; `theme="dark"` is always dark.
|
|
121
|
+
|
|
122
|
+
## Density
|
|
123
|
+
|
|
124
|
+
- **Density follows the story.** Would a person do this here? No element quota; empty space can be hierarchy; enlarge content before adding anatomy.
|
|
125
|
+
- **Never under about 320 wide for a demo;** a bento tile or a satellite card may be smaller. Below that, keep the action and readable type, drop the desktop anatomy.
|
|
126
|
+
|
|
127
|
+
## Chrome and devices
|
|
128
|
+
|
|
129
|
+
- **A messaging app on an iPhone keeps Messages' conventions** unless the brief gives it a look: blue sent bubbles (`--ss-accent` as the kit sets it), gray received, the plus and the mic in the composer, reactions on the bubble. "Our messaging app" names the product, not a palette; inventing an accent and a composer makes it read as a fake (`examples/messages`).
|
|
130
|
+
- **Does the frame help?** Browser chrome only when the browser is part of the picture; a desktop app gets its real chrome (`examples/chrome`).
|
|
131
|
+
- **Chrome for the task:** a sharing panel needs a document, permissions and an action; a browser bar explains nothing.
|
|
132
|
+
- **Columns run the full height of their window** (`Window sidebar`); a column that stops short leaves a seam (`examples/finder`).
|
|
133
|
+
- **Window chrome is fixed at 38px;** `barSize="tall"` (64px) only for a real icon-and-label toolbar (`examples/finder-glass`).
|
|
134
|
+
- **Never draw platform chrome from memory;** open the real app or a screenshot first.
|
|
135
|
+
- **macOS 26 Finder:** solid white window, only the floating sidebar is glass, gray glyphs, selected row on a gray pill (`examples/finder-glass`).
|
|
136
|
+
- **Quiet browser windows** center their content and carry a rounded, centered URL pill (`examples/static-card`).
|
|
137
|
+
- **A document that is not the hero is content:** a ruled page with real margins, not another window.
|
|
138
|
+
- **Phones come from the kit** (the frames are in `kit.md`, Phone); `photo` falls back to `pro`, never an empty bezel (`examples/phones`).
|
|
139
|
+
- **System surfaces keep their real proportions.** Never shrink the iOS clock; the payoff wins by content, timing and crop (`examples/dynamic-island`).
|
|
140
|
+
- **A notification is one bold title over its message** with `Notification`'s geometry and a real app icon (`examples/phones`).
|
|
141
|
+
- **Nothing sits under the island;** a sheet or grabber starts below the status bar.
|
|
142
|
+
- **The status bar and home indicator come from the Phone,** true to iOS, never drawn by hand. A second indicator inside the app shows as a bar that scales into place and a sliver under the real one. An app that covers a dark screen turns the Phone's `dark` off as its surface arrives, and both fade to dark.
|
|
143
|
+
- **A phone is lit from its first frame:** never dimmed, blacked out or faded up.
|
|
144
|
+
- **A phone background has a job:** `LockScreen` for notification and island stories; never invented home-screen icons (`examples/dynamic-island`).
|
|
145
|
+
- **A phone may straddle a window but never covers the amount it explains.**
|
|
146
|
+
- **Several windows:** choose the active step; quieter contrast and shadow push the others back (`examples/hero-demo`).
|
|
147
|
+
|
|
148
|
+
## A page of demos
|
|
149
|
+
|
|
150
|
+
- **One figure language:** one ground, one gutter, one window shadow (`--ss-shadow-hero`), one radius set; a different shadow says something or is a mistake.
|
|
151
|
+
- **Fewer, stronger demos.** No little labeled containers or text tiles when the demo says it.
|
|
152
|
+
- **A comparison pair shows a different demo** from the one just above it.
|
|
153
|
+
- **A bad example is marked in the page's own annotation style,** never with crosses or scrawls.
|
|
154
|
+
|
|
155
|
+
## Recipes
|
|
156
|
+
|
|
157
|
+
- **Scope the CSS to the demo:** nest the stylesheet under its root class (`@keyframes` outside); a prefix is not enough. Hosts styling prose by class exclude stages with `:not(:where(.ss-stage *))`.
|
|
158
|
+
- **`compact`** is a second design for the phone column, not a squeeze (`framing.md`, Small formats and the page).
|
|
159
|
+
- **Check a fresh load at each width and a resize between:** targets, clips, overlays, poster.
|
|
160
|
+
- **A grid of cards** is planned with `bento.md`.
|