Every site I’ve worked on eventually hits the same wall. The first few pages look great. Then a new landing page needs a slightly different button, a campaign needs its own card, and six months later there are fourteen shades of pink and nobody knows which one is right.
A design system is how you avoid that wall. It doesn’t have to be a huge corporate library. At its core, it’s a small set of decisions — colors, type, spacing, components — written down once and reused everywhere.
Start with tokens
Design tokens are the named values your whole design is built from: --color-primary instead of #ff2e97, --space-4 instead of 32px. They’re the single source of truth that keeps a designer’s Figma file and a developer’s code saying the same thing.
:root {
--color-primary: #ff2e97;
--color-accent: #00f0ff;
--color-surface: #111118;
--font-display: "Orbitron", sans-serif;
--space-2: 16px;
--space-4: 32px;
--radius-card: 20px;
}
CSS custom properties make tokens practical everywhere. Change one value and every button, card and link that uses it updates with it. Builders have caught up too: Elementor’s V4 editor, which I’ve been using a lot lately, has global variables and global classes that work the same way, so non-developers can edit the system without touching code.
Build fluid type and spacing
Instead of jumping between fixed sizes at each breakpoint, clamp() lets a value scale smoothly between a minimum and a maximum:
--text-h1: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
One line replaces three media queries, and headlines look intentional at every screen width, not just at the three you designed for.
Components should be responsive to their container
For a long time, responsive design meant media queries, which only know the size of the viewport. But a project card might sit in a three-column grid, a sidebar or a full-width carousel on the same page. Container queries — supported in every major browser since 2023 — let a component adapt to the space it actually has:
.card-wrap { container-type: inline-size; }
@container (min-width: 480px) {
.card { display: grid; grid-template-columns: 200px 1fr; }
}
This is a big deal for design systems. A component can be designed once, with its own breakpoints, and dropped anywhere without page-specific overrides.
Let :has() handle the edge cases
The :has() selector lets a parent style itself based on what’s inside it. A card with an image can use a different layout than a card without one, or a form group can highlight itself when its input is invalid, all without extra classes or JavaScript.
.card:has(img) { grid-template-rows: 200px auto; }
.field:has(input:invalid) { border-color: var(--color-primary); }
Keep the system small and documented
The systems that survive are the ones people actually use. A few habits that help:
- Mirror the same tokens and component names in Figma and in code, so design reviews and builds speak the same language.
- Document the why next to each component — when to use it and when not to.
- Add new components only when an existing one truly can’t do the job.
- Treat accessibility as part of each component: contrast, focus states and keyboard support built in once, inherited everywhere.
The takeaway
Modern CSS has turned design systems from a big-company luxury into something any project can have. Tokens give you consistency, clamp() and container queries give you true responsiveness, and :has() handles the edge cases. Put them together and every new page gets faster to build — and more consistent — than the last.