[ Case Study ]
Loom
A design system generator. Describe a brand in one short file, and Loom builds the styles every screen is made from — color, type, spacing, hover and focus — plus a matching Figma library.
- CSS
- Accessibility
- Design Tokens
- Figma Plugin API
[ The Problem ]
Every new project I started properly lost its first weeks to foundation work, set up once in Figma and again in code. The first versions of Loom answered that with a large library of React components. Building real products on it showed me that consistency lives less in the components than in the decisions under them: how a corner rounds, where a focus ring sits, how an error reads. Loom now makes those decisions once.
[ How It Works ]
One file goes in. A complete styling foundation comes out, with as little as possible on top.
- Primary color
- Font pairing
- Type scale
- Spacing density
- Edge style
- Color variables
- Spacing + radius
- Text styles
- Effect styles
- Design tokens
- Ready-made styles
- Interactive components
- One-command updates
- Primary color
- Font pairing
- Type scale
- Spacing density
- Edge style
- Color variables
- Spacing + radius
- Text styles
- Effect styles
- Design tokens
- Ready-made styles
- Interactive components
- One-command updates
One file describes the brand
A project's look starts as a short list of answers: brand colors, typefaces, how round the corners are, how dense the layout is, and whether it runs light or dark. Loom generates everything else from that file, so changing the brand means changing an answer and generating again, not hunting through stylesheets.
Colors built to pass contrast
Every shade is placed by brightness, so a role can use the same shade for any brand. Loom then measures the result for your brand, and a failed check stops the build. Text has to meet WCAG AA and borders have to reach 3:1. A brand ships in one mode, light or dark. The cost is that your hue survives but your exact color may not: a brand green of
#0f8a5fbecomes a primary of#006645in light mode.A shared style layer
From those answers Loom writes the design tokens, the raw values like colors and spacing, and a layer of ready-made styles on top: text styles, button and badge looks, hover, press and focus states, surfaces and shadows. Tokens alone still leave every project deciding how a corner rounds or how a focus ring looks. The style layer decides it once, so everything built on it looks like it came from the same hand. It's plain CSS, so it works in any framework, and a project can always override it.
Components only where behavior needs them
Most of a design system is styling, and styling is just CSS. Loom adds a React component mainly where an element has to behave, not just look a certain way, like a dialog that keeps keyboard focus inside it or a dropdown that positions itself. So the set is small on purpose: button, badge, dialog, select and tabs, plus a form field, checkbox, radio and switch. Those last three are the browser's own input underneath, restyled. The switch is drawn entirely by the styles, because browsers don't ship one, and the checkbox is a component only because its mixed state can't be set from markup.
Figma from the same source
The same answers build the Figma side: color, spacing and radius variables, plus text and effect styles. Both are built from the same source. A Figma file picks up changes when its scripts are run again.
One command to update
A project pulls Loom in with one command, either just the styles or the styles plus the components. The files are copied into the project and replaced on every update, so a project-specific tweak is made where a component is used, not inside Loom's files. That way an update never wipes out local work.
[ Decisions ]
Color is never the only signal
Loom's status colors, error, success and warning, are tuned to the same brightness on purpose. That keeps them balanced side by side and makes text on each of them equally readable. The trade-off is that without their hue they look identical: in greyscale, or to someone with red-green color blindness. I chose not to break that balance. Instead, the rule is that anything important pairs color with a second cue: an icon, a word, an outline. Loom's own interaction states follow it. Hover and press add a tint, disabled fades, and focus draws a ring, so none of them rely on color alone.
The tap area grows, not the button
Touch screens need tap targets of at least 44 pixels. The usual fix sets a minimum height, which stretches a square icon button into a tall rectangle and still leaves it too narrow. Making it a full 44-pixel square would make it heavier than everything next to it. Instead, small square buttons get an invisible tap area around them that meets the minimum in both directions, while the visible button stays the size it was designed at. The trade-off is that the tap area can overlap nearby elements, so spacing around one still matters.
Only build what's easy to get wrong
Loom used to include a top bar and an empty-state style. When I checked what a real project actually used, it had applied both and then overridden almost everything. Only the typography and background survived, and those already existed, so both were cut. What stays is what goes wrong when written from memory, like the keyboard-shortcut key cap, which needs a minimum width so a single narrow character still sits in a square key. The test isn't whether something looks like a component. It's whether building it by hand tends to go wrong.
[ Under the Hood ]
Four pieces of the real output, and the rest of the source on GitHub (opens in a new tab).
Two real projects on the same generator. Paperboy is a dense, square-cornered news reader; Party Wipe is an amber-gold game with Cinzel headings. Everything that makes them look different is in these few lines, and the code that builds their screens uses the same style names.
// Paperboy, a news reader
{
"$note": "…",
"styleDirection": "brutalist",
"primary": "#009cd6",
"secondary": "#0a37cc",
"accent": "#3f0acc",
"heading": "Inter",
"body": "Inter",
"edges": "none",
"density": "compact",
"shadowDepth": "flat",
"typeScale": "compact",
"controlHeight": "touch",
"defaultMode": "dark",
"projectName": "pb2"
}
// Party Wipe, a combat roguelike
{
"$note": "…",
"projectName": "party-wipe",
"styleDirection": "bold",
"defaultMode": "dark",
"primary": "#DAA520",
"secondary": "#2e5bcc",
"accent": "#29d1a1",
"heading": "Cinzel",
"body": "JetBrains Mono",
"edges": "sharp",
"density": "compact",
"shadowDepth": "flat",
"typeScale": "compact",
"controlHeight": "standard"
}[ More Case Studies ]
| Project | What it is |
|---|---|
| JAMIE | A persistent AI development partner built on agent harnessing and context engineering. |
| Lazy Dunmas | A D&D rules attorney on a local model, and the evals that score its retrieval and its rulings apart. |
| Paperboy | A news digest and the monitor behind it: charts that show which feeds are failing, and how. |
| Party Wipe | A solo D&D combat roguelike for encounters that go sideways. |
| Taulu | A digital bulletin board for spontaneous event planning — events are posters, your people and calendars are the boards. |
| ez-prompt | A glossary of camera, tone, light and texture terms that turns a chosen look into an image prompt. |