Organism · stable · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)
Do and don't
Do: In the problem section
Rendered by drift-palette.tsOpen example: Drift palette · Do: In the problem section Use the full-page example to follow page links.
Do: Japanese
Rendered by drift-palette.tsOpen example: Drift palette · Do: Japanese Use the full-page example to follow page links.
Don't: Without commit and date
Rendered by drift-palette.tsOpen example: Drift palette · Don't: Without commit and date Use the full-page example to follow page links.
Don't: Recoloured to the brand
Rendered by drift-palette.tsOpen example: Drift palette · Don't: Recoloured to the brand Use the full-page example to follow page links.
Rules
| Rule | Why | Check |
|---|---|---|
| The drift palette is drawn from the raw colours Loom's audit found in an open-source app at a named commit at build time. | A figure read from the real records cannot drift from them. | Automated: npm run site:build (reads the data; fails if it is missing) |
| Swatches show the exact raw values found, and only here may raw colours appear. | They are evidence, not styling; the brand gate exempts this data, not any stylesheet. | Automated: brand gate (inline colours: evidence attributes only) |
API
| Prop | Type | Required | Default | What it does |
|---|---|---|---|---|
lang | en | ja | No | "en" | Interface language. |
Contract details
The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests
Identity
| Aspect | Value |
|---|---|
| Id | drift-palette |
| Layer | Organisms |
| Category | figure |
| Owner | Site system lead |
| Status | stable |
| Version | 1.0.0 |
| Source | apps/showcase/site/system/organisms/drift-palette.ts (private repository; the contract and the render function are this one module) |
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-10-26 | Drift palette, drawn at build time from the raw colours Loom's audit found in an open-source app at a named commit. |
Use when
- The problem section of the landing. Why: A wall of near-duplicate colours makes drift obvious in a second.
Do not use when
- As decoration. Why: Every swatch is a finding with a source.
Anatomy
| Part | What it is |
|---|---|
| root | figure.ix-dp |
| grid | Swatches of each raw value |
| facts | Counts and the commit |
| caption | Repository, commit, date |
Made of: figure-frame, stat, caption.
Used in: problem-section.
Variants
| Variant | When | Why |
|---|---|---|
| default | Wherever its claim is made. | One drawing per claim keeps the evidence consistent. |
States
| State | Rendered or not applicable |
|---|---|
| default | All found-color swatches, facts and source commit/date are complete build-time content, with an optional once-only managed entrance. |
| hover | Not applicable: Swatches/facts are evidence, not controls; no intrinsic hover action. |
| focus-visible | Not applicable: The figure itself and aria-hidden swatches do not receive focus. |
| active | Not applicable: A once-only entrance is motion, not a pressed or selected input state. |
| disabled | Not applicable: No control to disable. |
| loading | The complete static palette/facts/caption remain readable while the optional managed entrance chunk loads. |
| empty | Not applicable: The fixed audit report supplies the palette; there is no caller empty-data variant. |
| error | Caught optional chunk/init failure restores the static figure and host failed state; remount may retry. Missing build data remains a build failure, not an empty successful figure. |
| current | Not applicable: No selected swatch, frame or current-step control. |
| visited | Not applicable: The figure has no link/history state. |
| expanded | Not applicable: The figure does not disclose content. |
Tokens
| Part | Token |
|---|---|
| swatch | the found colour itself (the only place raw values appear, as evidence) |
| facts.font | --type-small |
| --drift-palette-background-surface | var(--surface) |
| --drift-palette-color-ink | var(--ink) |
| --drift-palette-padding-space-6 | var(--space-6) |
| --drift-palette-padding-space-9 | var(--space-9) |
| --drift-palette-gap-space-8 | var(--space-8) |
| --drift-palette-border-top-rule-frame | var(--rule-frame) |
| --drift-palette-border-top-ink | var(--ink) |
| --drift-palette-gap-space-2 | var(--space-2) |
| --drift-palette-background-surface-2 | var(--surface-2) |
| --drift-palette-padding-space-2 | var(--space-2) |
| --drift-palette-box-shadow-ink | var(--ink) |
| --drift-palette-gap-space-5 | var(--space-5) |
| --drift-palette-gap-space-6 | var(--space-6) |
| --drift-palette-gap-space-1 | var(--space-1) |
| --drift-palette-border-top-rule | var(--rule) |
| --drift-palette-border-top-madder | var(--madder) |
| --drift-palette-padding-top-space-3 | var(--space-3) |
| --drift-palette-font-type-h2 | var(--type-h2) |
| --drift-palette-letter-spacing-ls-h2 | var(--ls-h2) |
| --drift-palette-font-type-small | var(--type-small) |
| --drift-palette-color-ink-2 | var(--ink-2) |
| --drift-palette-animation-dur-slow | var(--dur-slow) |
| --drift-palette-animation-ease-enter | var(--ease-enter) |
| --drift-palette-animation-delay-stagger | var(--stagger) |
| --drift-palette-animation-dur-weave | var(--dur-weave) |
| --drift-palette-animation-delay-dur-weave | var(--dur-weave) |
Layout
| Aspect | Value |
|---|---|
| breakpoints | Required review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; the figure reflows to one column under 768 px. |
| wrapping | Labels wrap; drawings scale to the column. |
| textExpansion | Japanese labels are 20 to 40% longer and wrap inside their cells. |
Spacing and rhythm
| Aspect | Value |
|---|---|
| internal | Inside the Figure frame's --space-7 padding. |
| external | --space-9 above and below in prose. |
| rhythm | After the text whose claim it proves. |
Motion
| Aspect | Value |
|---|---|
| moves | The existing palette swatches/facts entrance plays once on visible entry; found colors and source geometry stay unchanged. |
| trigger | Managed visible entry at threshold0.4 through the existing jobs-strip shared initializer. |
| duration | Existing drift-palette CSS profile; no shared showcase frame hold is introduced. |
| easing | Existing registered CSS entrance easing. |
| interruptible | Hidden/offscreen/reduced preference settles/cancels root animations. No automatic restart after interruption; disposal restores static markup. |
| reduced | Static authored palette; no automatic entrance. |
| why | Preserves the existing one-time illustration without inventing reader playback controls. |
Runtime and reuse
stylesheet: /css/site.css. Built Site tokens, core and registered element CSS; preserve modes, focus and responsive rules.
stylesheet: /css/demos.css. Existing legacy demo styles where the rendered specimen uses them.
font: /fonts/. Self-hosted files referenced by Site @font-face, with licences; Japanese locale overrides remain applicable.
Static fallback: Original build-time specimen remains readable before loading and after chunk/initialization failure; enhancement controls retain authored hidden state.
Configured initializer: apps/showcase/site/interactives/jobs-strip.ts#init. The host owns transactional static-markup restoration and runtime state.
Consumer module (imports relative to the configured source root): import { createRuntimeHost } from "./src/workflows/runtime-host"; import { SITE_RUNTIMES } from "./apps/showcase/site/runtime-registry"; const definition = SITE_RUNTIMES.find(entry => entry.binding.id === "drift-palette"); if (!definition || definition.binding.lifecycle.kind !== "managed") throw new Error("Managed runtime binding unavailable"); const host = createRuntimeHost([definition]); export function mountRuntime(container: ParentNode) { return host.mountAll(container); }After inserting the rendered markup, call mountRuntime(container) for the container holding [data-demo="drift-palette"]. Retain the returned disposal function and call it before removing, replacing or remounting, including every Storybook args render. The configured host restores captured static markup/attributes on disposal or caught load/initialization failure; retry starts a fresh managed remount.
Accessibility passport
| Aspect | Value |
|---|---|
| role | figure, named by its caption |
| name | The caption, and a text alternative for any drawing |
| keyboard | Not interactive unless stated. |
| focus | Links inside are in reading order. |
| screenReader | Reads the figure's text and caption; drawings have role=img with a description. |
| contrast | Ink on surface 14:1; dyes used only as marks with their words. |
| target | Not a target. |
Content
| Slot | Length | Voice |
|---|---|---|
| caption | 1 sentence | Which app, which commit, which date |
Good: “Raw colours in takenote at commit abc123, read on 25 October 2026.”
Bad: “Example palette”
Japanese: i18n.ts ix.dp.*.
Icons and illustrations
None: this element uses no icon or illustration of its own.
Decisions and exceptions
Usage
6 uses across the built pages (measured by npm run site:system).
Tests
| Aspect | Value |
|---|---|
| unit | tests/unit/site-system.test.ts: renders every do and don't example through the registry and checks the classes it owns |
| visual | Not yet: there are no screenshot baselines; the Library page is checked for sideways scroll at 1440 px by tests/site/system.spec.ts |
| a11y | tests/site/system.spec.ts: axe (0 serious or critical) on the element's Library page in light and dark |
| parity | scripts/site/system/check.ts: Library examples are rendered by the same render function the site imports |
Figma
not-yet: The Loom Site Figma library is the last stage of the plan; this element is not mapped yet.