Work/CotonAI Design System
Case study ( 03 ) ยท CotonAI
CotonAI Design System
Building a design system from scratch for an AI canvas: one token file that designers, engineers and AI agents all build from.
Overview
CotonAI is an AI canvas for fashion teams. I joined as founding product designer in August 2025 and own the design system. Three kinds of builder use it: designers working in Paper, engineers working in Tailwind, and AI agents that draft UI code.
I treated the system as a design problem and ran a double diamond. I audited the codebase first, then defined the question, then made one token file the source. Stage 1 of 4 is applied, so every number here is a stage 1 number.

Discover & Define
The first job was to find out what the interface was really made of. I audited the src folder on 11 November 2026 and checked every text pair for contrast.
The cause was a missing source. Colour, size and controls were decided again in every file.
- 1,411raw hex colours in 187 files
- 490raw buttons, while only 5 files import Button
- 669arbitrary text sizes, like text-[13px]
- 10files build their own dialog, sheet or drawer
- 7shadcn components imported nowhere
- 3.5:1contrast of the old muted gray on white
Here's what that caused
Reading both token sources side by side showed five problems.
- Two files defined colour and disagreed: shadcn's HSL variables in index.css against hex in boardUiTokens.ts, which 106 files import.
- Buttons and overlays were rebuilt in each file instead of reused.
- Sizes were decided file by file, so type drifted too.
- Nothing checked contrast, so a gray that fails AA shipped.
- Changing one shape would touch about 106 files.
Make the right colour the easiest one to use?
Design & Validate
Five principles shaped every decision. Each one is something a person or a machine can check.
Generated
One JSON file, cotonai.tokens.json, is the only file edited by hand. It generates the CSS variables, the Tailwind theme, a TypeScript module and the Figma import files.
Semantic
Components read roles such as bg-surface and text-muted, never raw values. Primitives only define the roles. The palette is generated in OKLCH, with the brand blue, red and purple pinned.
Themed
Light and dark use the same names, so a component never changes structure between themes. Swapping the token set is the only difference.
Interactive
Default, hover, pressed, focus and disabled are drawn for every component. The demo runs the real components on the real tokens, and Before and After swaps in the old token set.
Accessible
Contrast is a failing check. 250 of 250 text and UI pairs meet WCAG 2.2 AA, and the gate also fails if a generated file is stale.
Design System Structure
The Paper file has four pages: seven Foundations boards, 35 component artboards, 13 patterns and an Index that says which component to use for which job. Six base shells sit under the components. They are designed in Paper and not built in code yet.
Design Token
Tokens are split by how widely they apply. A change at the bottom reaches everything above it. One example per layer.
- Component token
--color-nav-fg-idle - Semantic token
--color-accent-default - Primitive token
--color-blue-600 - Raw value
#0076C7
Primitive tokens
97 raw values: one neutral ramp and five hues, generated in OKLCH. Never used directly in components.
Semantic tokens
105 roles per mode, light and dark. This is what components use.
Component tokens
Only where a component truly differs from the semantic set, such as nav and toggle colours.
Dimensions
100 variables for spacing, radius, size, type, opacity, duration and layers, plus 7 effects.