Read your own stylesheet

Runs part of Loom's audit in the browser on the reader's own CSS or token file, and leads with what it found. Nothing is sent anywhere.

Organism · stable · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)

Do and don't

Do: The demo

Rendered by read-your-stylesheet.ts

Open example: Read your own stylesheet · Do: The demo Use the full-page example to follow page links.

The reader's own code, read locally.

Do: Leads with the finding

Rendered by read-your-stylesheet.ts

Open example: Read your own stylesheet · Do: Leads with the finding Use the full-page example to follow page links.

The answer before the details.

Don't: Sending code to a server

Rendered by read-your-stylesheet.ts

Open example: Read your own stylesheet · Don't: Sending code to a server Use the full-page example to follow page links.

It must run in the browser; the privacy line promises it.

Don't: Claiming all eight areas

Rendered by read-your-stylesheet.ts

Open example: Read your own stylesheet · Don't: Claiming all eight areas Use the full-page example to follow page links.

It reads two; it says so.

Rules

RuleWhyCheck
Read your own stylesheet is computed by Loom's code from Loom's own audit code, run in the reader's browser on pasted CSS or tokens, not drawn by hand.A showcase is proof only if the product's own code produced what it shows.Automated: scripts/site/interactives/check.ts (recomputes the showcase data and fails on drift)
The audit runs in the browser; nothing is sent.People paste private code only when they know it stays with them.Automated: tests/site/demos.spec.ts (no network requests during the run)

API

PropTypeRequiredDefaultWhat it does
langen | jaNo"en"Root interface locale; changing it requires disposal and preparation. Existing source output and static explanatory copy remain English.
instanceKeystringNoOptional deterministic unique key for repeated static specimens; letter first, then letters, digits, underscore or hyphen, up to64 characters. Omit for the existing singleton anchors; duplicate explicit keys are unsupported.

Contract details

The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests

Identity

AspectValue
Idread-your-stylesheet
LayerOrganisms
Categoryshowcase
OwnerSite system lead
Statusstable
Version1.0.0
Sourceapps/showcase/site/system/organisms/read-your-stylesheet.ts (private repository; the contract and the render function are this one module)
VersionDateChange
1.0.02026-10-26Read your own stylesheet: computed by Loom's code from Loom's own audit code, run in the reader's browser on pasted CSS or tokens.

Use when

  • The See page and its demo page. Why: The reader's own code is the most convincing input.

Do not use when

  • To claim a full audit. Why: It reads two of eight areas; the rest need the repository, and it says so.

Anatomy

PartWhat it is
rootdiv.demo[data-demo=mini-audit]
inputTextarea and presets
leadThe lead finding sentence (ix-read-found)
outputRaw colours, contrast and coverage
nextThe links to a Quick audit and the health check

Made of: showcase-frame, form-field, control, finding, band-word, arrow-link, caption.

Used in: pages directly.

Variants

VariantWhenWhy
fullOn its demo page and its section.The whole experience where the claim is made.

States

StateRendered or not applicable
defaultA preset already read, with its findings
hoverPreset chips show hover.
focus-visibleThe --focus ring on the textarea and chips.
activeRunning: a status line with the time taken.
disabledNot applicable: Never.
loadingRuns in a few milliseconds; the status says 'checked in N ms'.
emptyAn empty input says what to paste.
errorUnparseable input is read as plain text and says so; nothing crashes.
currentThe chosen preset is pressed.
visitedNot applicable: Not a link.
expandedNot applicable: Does not open.

Tokens

PartToken
found.rule--rule --ix-wait
pair.fail--madder-ink word
pair.pass--teal-ink word
--read-your-stylesheet-gap-space-7var(--space-7)
--read-your-stylesheet-gap-space-9var(--space-9)
--read-your-stylesheet-gap-space-5var(--space-5)
--read-your-stylesheet-font-type-labelvar(--type-label)
--read-your-stylesheet-color-ink-2var(--ink-2)
--read-your-stylesheet-padding-space-6var(--space-6)
--read-your-stylesheet-color-term-fgvar(--term-fg)
--read-your-stylesheet-background-term-bgvar(--term-bg)
--read-your-stylesheet-border-line-strongvar(--line-strong)
--read-your-stylesheet-border-radius-radiusvar(--radius)
--read-your-stylesheet-outline-indigo-inkvar(--indigo-ink)
--read-your-stylesheet-gap-space-4var(--space-4)
--read-your-stylesheet-padding-space-2var(--space-2)
--read-your-stylesheet-padding-space-5var(--space-5)
--read-your-stylesheet-background-cottonvar(--cotton)
--read-your-stylesheet-background-inkvar(--ink)
--read-your-stylesheet-color-cottonvar(--cotton)
--read-your-stylesheet-gap-space-6var(--space-6)
--read-your-stylesheet-margin-top-space-4var(--space-4)
--read-your-stylesheet-font-size-fs-smallvar(--fs-small)
--read-your-stylesheet-margin-top-space-3var(--space-3)
--read-your-stylesheet-border-linevar(--line)
--read-your-stylesheet-color-teal-inkvar(--teal-ink)
--read-your-stylesheet-padding-bottom-space-5var(--space-5)
--read-your-stylesheet-font-type-h2var(--type-h2)
--read-your-stylesheet-letter-spacing-ls-h2var(--ls-h2)
--read-your-stylesheet-margin-right-space-4var(--space-4)
--read-your-stylesheet-ix-ok-teal-inkvar(--teal-ink)
--read-your-stylesheet-ix-wait-saffron-inkvar(--saffron-ink)
--read-your-stylesheet-ix-broken-madder-inkvar(--madder-ink)
--read-your-stylesheet-ix-action-indigo-inkvar(--indigo-ink)
--read-your-stylesheet-border-top-rulevar(--rule)
--read-your-stylesheet-margin-space-7var(--space-7)
--read-your-stylesheet-font-type-h3var(--type-h3)
--read-your-stylesheet-margin-space-4var(--space-4)
--read-your-stylesheet-letter-spacing-ls-h3var(--ls-h3)
--read-your-stylesheet-margin-space-5var(--space-5)
--read-your-stylesheet-gap-space-3var(--space-3)

Layout

AspectValue
breakpointsRequired review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; columns stack under 768 px and controls fill the row on phones.
wrappingText wraps; code panes scroll inside their own focusable region.
textExpansionJapanese strings come from the i18n tables and wrap; engine output stays English.

Spacing and rhythm

AspectValue
internalInside the Showcase frame's padding, controls and caption at its foot.
externalFull width of its section.
rhythmOne showcase per section, after the section's claim (D-SITE-008).

Motion

AspectValue
NoneResults replace the previous ones when the reader runs the audit; nothing plays.

Runtime and reuse

  1. stylesheet: /css/site.css. Built Site tokens, core and registered element CSS; preserve modes, focus and responsive rules.

  2. stylesheet: /css/demos.css. Existing legacy demo styles where the rendered specimen uses them.

  3. font: /fonts/. Self-hosted files referenced by Site @font-face, with licences; Japanese locale overrides remain applicable.

  4. data: /i18n/ja.json. Required for a Japanese root; English interface fallbacks are authored in source. Root language changes require disposal and fresh preparation.

  5. Static fallback: Original build-time specimen remains readable before loading and after chunk/initialization failure; enhancement controls retain authored hidden state.

  6. Before DOM initialization the configured host awaits apps/showcase/site/demos/mini-audit.ts#prepare for this root with a mount-owned AbortSignal. Preparation must throw on missing/invalid data; disposal/replacement aborts pending work, and a stale result cannot initialize or claim ready.

  7. Configured initializer: apps/showcase/site/demos/mini-audit.ts#init. The host owns transactional static-markup restoration and runtime state.

  8. 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 === "mini-audit");
    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); }
  9. After inserting the rendered markup, call mountRuntime(container) for the container holding [data-demo="mini-audit"]. 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

AspectValue
roleregion with a heading, or a figure
nameIts heading or caption
keyboardTab to the controls; Space plays or pauses; arrows move the steps; End shows the last step.
focusControls in reading order; focus never moves on its own.
screenReaderManual frame selection and pause announce their settled content. Explicit Play announces the final settled summary once; autoplay and system interruption/disposal stay silent. Legacy initializers outside the shared player remain explicitly unassessed.
contrastInk on surface 14:1; state dyes only as marks with words.
targetControls are 44 px.

Content

SlotLengthVoice
lead1 sentenceThe finding first: '8 raw colours…'

Good: “8 raw colours. Each one is a decision about colour that nobody made at the system level.”

Bad: “Your CSS is bad”

Japanese: Interface translated; findings stay English with a note.

Icons and illustrations

None: this element uses no icon or illustration of its own.

Decisions and exceptions

Usage

40 uses across the built pages (measured by npm run site:system).

Tests

AspectValue
unittests/unit/site-system.test.ts: renders every do and don't example through the registry and checks the classes it owns
visualNot yet: there are no screenshot baselines; the Library page is checked for sideways scroll at 1440 px by tests/site/system.spec.ts
a11ytests/site/system.spec.ts: axe (0 serious or critical) on the element's Library page in light and dark
parityscripts/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.

Open in Storybook

Start with a conversation about your system.

We read your system, show you what we found, and agree with your team what to fix first.