Nebula Design System · Learning project
One Figma file,
every component in sync
I built a design system from scratch to learn how real ones are made, and why they are made that way. Every colour, size and style is a token in Figma, generated into code, so components can only use system values. 1,343 tokens, 11 components, a docs site and a Storybook.
Values typed by hand drift apart, and a product's parts stop matching.
Components built as infrastructure: scalable, modular, styled only by tokens.
Zero hard-coded colours, and a system I can explain decision by decision.
I wanted to find out whether one Figma file could drive the code with zero hard-coded values. Result: 0 hard-coded colours in component code, and 30 sizes flagged openly because no token exists for them yet.
- Role
- Solo · system design in Figma, built with AI
- Scope
- Foundations, tokens, 11 components, docs
- Tools
- Figma variables · Style Dictionary · Tailwind · React · Storybook · Claude Code
How it fits together, in three screens



Components are the infrastructure of the product
Everything in Nebula follows from one idea: take large-scale components and build them in a scalable and modular way.
A product is assembled from components the way a building is assembled from its structure. Get them right once, and every screen inherits it.
Scale up or scale down
One component covers every size and density through properties, not copies.
In NebulaButton has four sizes, xs to lg. The xs size was added for Empty State, without a second button.
Fix just that module
Each component is its own module, so maintaining or fixing one never touches the others.
In NebulaWhen Badge was replaced with a corrected Figma version, Tag, which uses Badge for its count, updated with no change of its own.
A design system is a product of its own
It is design infrastructure: designed, maintained and improved, and its users are designers and developers.
Single source of truth
One place where every value is decided.
A common language
Designers and developers name things the same way.
A stable product
Branding and experience stay aligned across every touch point.
Governance
Changes follow a process instead of happening screen by screen.
Three goals, and what I left out
A learning project needs a clear edge, or it never ends.
One source of truth
Figma variables are the only place a value is set. Code is generated from them.
Off-system is impossible
A class that isn't a token can't be written, and the audit fails if one slips in.
Explainable
Every component documents its tokens, states, accessibility and Figma review.
In scope
- Colour, type, spacing, grid, elevation
- Three-tier tokens and the code pipeline
- 11 components, documented and tested
Out of scope, for now
- Dark mode and multiple brands
- Motion tokens (values proposed only)
- Publishing as a package; use in a real product
Build it like a monster, protect it like a child
Building and keeping are two different jobs, and a system needs both.
Build it like a monster
Be thorough and ambitious when building: cover every foundation, every token tier, every state.
- Product audit
- Style guide and tokenisation
- Master library creation
Protect it like a child
Once released, guard it: changes go through a process, so it doesn't overload, drift apart and get abandoned.
- Contribution is always open, but governed
- Inconsistencies are removed, good patterns kept
- The audit repeats: yearly, quarterly or every release
The steps I followed
From a loose vision to exact rules anyone can follow: strategy → framework → system → process.
Style guide
Colour, type, space, grid
Tokens
Base, semantic, component
Library
Figma component sets
Code
Built, audited, tested
Sanity audit
The system against its own rules
Docs
Site, Storybook, health
Auditing: what it looks like for a real product, and what I did
A real audit comes first and makes the case for the system. Nebula had no product to audit, so I audited the system itself, against its own rules.
For a real productMethod · not done for Nebula
The audit is the first of three phases: product audit → style guide and tokenisation → master library.
- Keep the patterns that work. They are added to the design system.
- Remove the inconsistencies.
- Extract the style guide, the fundamental building blocks, then tokenise it and build the master library.
- Update and report constantly to designers, engineers and stakeholders.
If the product is being redesigned, skip the audit and explore a new design language instead. Either way, the three phases repeat: quarterly, half-yearly or yearly.
What I did: a sanity audit of Nebula
Class audit
Figma
tag-text in some states and badge-text in others.Figma
Contrast check
Each finding stays visible: the code flags it, the Token health page lists it, and it shaped a later decision (the new text token, the naming rules).
Foundations at a glance
The building blocks every component is made from. Colour and type get their own case studies below.
Colour →
17 HSL ramps, 10 steps eachTypography →
74 styles, mobile and desktopSpacing
Gaps grow with size: +2, +4, +8, +16, +32Grid
4 · 6 · 12 columns at 360 · 768 · 1280Rule
Why Nebula's spacing and grid are the way they are
SpacingSmall steps for small sizes, bigger jumps for big ones
4 · 6 · 8 (+2), 12 · 16 · 20 · 24 (+4), 32 · 40 · 48 (+8), 64 · 80 · 96 (+16), then +32 up to 256. Close values where precision matters, far apart where it doesn't.
GridDesign for the primary platform, at the worst scale first
360px, 4 columns for phones, 768px, 6 columns for tablets, 1280px, 12 columns for data-dense desktop. Margins on tablet sit between phone and laptop.
Five problems inside one system
Each one shows the rules I followed, the decisions I made, and why.
Case study 1 of 5 · Colour
A colour system that passes contrast, not just looks right
BetCan 17 ramps give every role (surface, text, border, icon) a step that is readable?
17 ramps, every step measured
Each hue has 10 steps, built in HSL, from light tints (lightness ≈ 95) to dark shades (≈ 25).
passes 4.5 : 1 on white, so it can be used for body textComputed from the real tokens
The rules behind the ramps
Each rule, and where it shows in the real values.
Rule
What the Nebula ramps do
Lightness gapsSmall gaps at the light end, larger gaps in between, so neighbouring steps never look the same
Violet lightness: 96 → 92 → 86 → 78 → 68. Gaps of 4, 6, 8, 10, then a steady 8 down to 26.
SaturationLess saturation for darker colours, more for lighter ones, to meet contrast without going muddy
Violet saturation falls from 70 in the tints to 60–62 in the shades.
YellowHSL can't make a darker yellow stay bright, so lower the hue towards orange
Amber hue moves from 47° to 41° as it darkens.
Green and blueThey take up a lot of the colour gamut, so keep their saturation in check: around 55 for enterprise, 60–70 for consumer apps
Green saturation stays around 55 across the ramp.
Roles, not hues, in a 60-30-10 split
Components never ask for “violet-600”. They ask for a role, and the role points to a step.
Contrast is a rule, not a look
Text under 24px needs 4.5 : 1 (AA). Large text, 24px or 18.66px bold, needs 3 : 1. Primary text and action colours aim for these first.
Chose
A new token, text/default/primary/medium (grey-600, 6.1 : 1)
Over
Darkening the existing secondary grey-500 (3.5 : 1)
Because
Changing an existing token silently changes every component that Figma already approved. A new token is a proposal I can review first.
Contrast checkWhen the check and the design disagreed
Storybook's accessibility check flags the Alert's colours as a serious contrast problem. I kept them as designed, and wrote it down.

A ramp is a set of rules, not a set of nice colours. Contrast is decided where the colour is defined.
Case study 2 of 5 · Typography
A responsive type system, built on five pillars
BetCan one set of style names, with a mobile and a desktop size, serve both platforms?
The five pillars, and what Nebula chose
Size, weight, line height and letter spacing depend on the typeface, so the family comes first.
Choosing the structure
Chose
Four groups (Display, Heading, Body, Label) plus Code, in mobile and desktop
Over
Two groups (heading, body) or three (heading, body, label)
Because
Three groups are the sweet spot for a single-platform app. Nebula serves phone and desktop, so it needs a display tier for large screens and a separate size for each platform.
74 stylesOne name, two sizes
Named platform / group / style, so “body-b1” means the same role on a phone and a laptop.
Light bar: mobile · Dark bar: desktop · font size / line height in px
Checking it against the rules
Writing the rules next to the real values showed what to change in the next version.
Rule
Nebula today
ScaleFont size = base size × a multiplier: about 1.15–1.2 on desktop, 1.1–1.15 on mobile
Desktop headings step by a fixed 8px (24 → 32 → 40 → 48), so the ratio shrinks as sizes grow. A ratio scale would grow more evenly. Next version
Line heightTop headings 110–120%, body 130–150%, labels 120–140%
Body is 125% (16/20), a little tight for long reading, so the docs use 1.6 and propose a line-height/relaxed token.
ResponsiveKeep the hierarchy the same on both platforms; only the scale changes
Components step body and label text up by 2px from 768px. Headings stay, because desktop headings are about 1.5× larger and would break a component's proportions.
A type system is a structure first: decide how many tiers the platforms need, then the sizes.
Case study 3 of 5 · Tokens and variables
Naming every decision once
BetThree tiers, so one change in Figma reaches every component that uses it.
Two rules behind every token
One task, one way. Each property has only one unique way to be set.
In code it's the same rule: an inline style is a one-off; a class is reusable. Nebula styles components only with token classes.
Strip it down to the essentials
Take the customisation away and keep the base structure: height, width, size, space, colour. What's left is the product's core personality, and that core is what tokens store.
Why it mattersAbstraction is what makes theming possible: change the values, keep the structure, and the product gets a new identity.
One value, three names
Base holds the raw value. Semantic gives it a meaning. Component gives it a job. This is the real chain behind the primary button.
Naming rules I followed
Rule
In Nebula
VariableA bucket: a reusable way of storing a value and calling it again and again
color.surface.brand.primary.primary-bold is used, never #7033CC.
ChainingLink semantic variables to base ones, so a base change flows up
Every semantic and component token is a reference, not a copy of a value.
NamingAll lowercase, and the fewest variables that still give full control
Lowercase throughout. The trade-off: 339 component tokens give fine control but are a lot to maintain.
ExceptionsShadow, gradient and opacity don't have to come from variables
Shadows and focus rings are effect styles: 11 of them.
From Figma to code, automatically
No value is copied by hand. One command rebuilds the code from the Figma export.
Chose
Deleting Tailwind's default colours and scales
Over
Adding Nebula's tokens next to them
Because
DRY again: with the defaults gone there is only one way to style. An off-system class like bg-blue-500 simply doesn't exist, and the audit fails if anyone tries.
When a token is missing
Some Figma values had no semantic token. Guessing a nearby one would hide the gap.

Name a decision once, and make every gap visible. Tokens are the system's memory.
Case study 4 of 5 · Component design and testing
Designing components as a blueprint for code
BetCan every Figma component match its code part for part, so design and development speak the same language?
Component architecture: a strategy, not a drawing
Architecture is how components are designed in Figma. It acts as a blueprint for developers and keeps design and code matched.
Size, type and state as variants. Nebula's Button: 8 types × 4 sizes × its states.
Alert and Empty State use Button. Tag uses Badge for its count.
Properties for what changes inside a component, composition for what it contains. This is what keeps it modular.
Naming components
Naming is a small science of signs. A name can describe how a component looks, what it does, or both.
Names the form. Breaks when the look changes.
Names the role. Stays true when the visual design changes, which a system will.
Clear and scalable for big libraries; more than Nebula needs today.
Building it in Figma: the property rules
Rule
In Nebula's components
OrderPut the most common properties first: dropdowns (size, type, state), then booleans, then text
Button in Figma: Type · State · Size, then Show Leading / Trailing / Loading Icon, then the two labels.
NamesBooleans start with “Show”, swaps and text with “Change”
Show Leading Icon, Show Helper Text, Change Label, Change Initials: 15 properties follow it.
Auto layoutThe outer frame hugs its content, inner parts fill the width; set min and max widths to stop unwanted resizing
The Button label truncates at a max width of 220px instead of stretching the button.
TextKeep one-line text to one line: truncate, max lines 1
Tag and Button labels truncate with an ellipsis.
Building it in code, with AI
I wrote the rules once as skills: a parent skill directs the work, and child skills each know how to do one job.
Testing: four layers, three done
Most of a system's time goes into keeping it right, so checks are automated where possible.
- Component statesEvery variant, size and state as a Storybook story: 60 stories
- AccessibilityAn automated check on every story, plus keyboard and focus checked by hand
- Cross-platformChecked at phone, laptop and full-HD widths; text adapts at 768px
- Visual regressionNot done: no saved screenshots to compare after a change

A component is a contract between design and code. Its architecture, name and properties are the contract's wording.
Case study 5 of 5 · Strategy and governance
Design-system strategy for a team of one
BetWhich strategy fits a single-brand system with one maintainer and no product yet?
A design system follows the product, it doesn't lead it. We make design-system decisions because of the product.
So system designers are curators first and innovators later. This is Nebula's biggest limit: with no product yet, some of its decisions are educated guesses that a first real product would test.
Where Nebula is in its lifecycle
A healthy system loops. An unprotected one overloads, drifts apart, gets abandoned and is rebuilt.
Three choices
Over multi-brand: a branded house (a main library with local ones) or a house of brands. One brand needs one source of truth.
Enterprise tools lean about 80% consistency, consumer apps about 60/40. A new system needs strict defaults before it can afford exceptions.
Over centralised (quarterly reviews) or federated (a community, every release). With one maintainer, the rules live in the docs and the audit.
How it stays protected
Token health
Every value without a token and every contrast finding, listed automatically from the code.
Docs siteProposed Improvements
Contribution is open but governed: fixes go into a copy of the Figma component to review, never into the original.
FigmaClass audit
A check that fails if any class isn't a token. It runs on every component.
CodeHow it would be adopted Untested · plan only
Talk to developers first and get the agreement in writing. Design adopts it first, then development.
Chose
Phased adoption: all new work uses the system, then existing screens move over feature by feature
Over
One shot: redesigning the whole product at once
Because
The system follows the product. Phases let each feature test the system, and the system improve in small releases. Then Educate, Engage, Evolve: teach it, work hands-on with designers, raise the bar.
PlanEven alone, write the rules down. With one maintainer, the docs are the governance.
Two places to learn the system
Figma is the source of truth. The docs site explains how and why, and Storybook lets you try every state.


What I can measure, and what I can't
No team uses Nebula yet, so I only claim what the files show.
Design speed with the library vs without it
Developer speed and fewer review comments
Fewer inconsistencies in a real product
What I decided, and what AI built
I designed the system and made the calls. AI wrote most of the code, and I reviewed it.
I decided
- The tokens, styles and components in Figma, and the three-tier structure
- The skills' rules: how to build a component and how to apply tokens
- Corrections where AI got it wrong: the tooltip triangle, the empty-state shadow, the avatar photo
- Keeping component colours as in Figma: documented, not changed
AI built, from my rules
- The Style Dictionary pipeline and the Tailwind theme
- React components from my Figma links, through the orchestrator and its skills
- The docs site, Storybook and the checks
- Where it went wrong: mobile type on desktop, and turning every gradient purple when I asked for two
What I learned, and what I'd do differently
Writing my rules next to the real values taught me the most.
Explore Nebula
The live docs site, below. Storybook and the Figma file are one click away.