---
title: "Design Systems @ Replit: Better Tokens"
description: "Replit rebuilt the token layer of its RUI design system, the base of a hierarchy running tokens → utilities → components → patterns → design guidance."
url: "https://swe.quest/articles/design-systems-replit-better-tokens-145fca0668bb5424"
canonical: "https://replit.com/blog/rui-tokens"
source: "Replit"
published: "2021-10-26"
difficulty: "medium"
kind: "Case study"
reading_minutes: 5
tags: ["design-systems","css","frontend"]
---

# Design Systems @ Replit: Better Tokens

A post on [Replit](https://swe.quest/sources/replit.md), published 2021-10-26, 5 min read, Case study. Original: [https://replit.com/blog/rui-tokens](https://replit.com/blog/rui-tokens)

## Summary

Replit rebuilt the token layer of its RUI design system, the base of a hierarchy running tokens → utilities → components → patterns → design guidance. Numbered and vague names like \`foreground-3\` or \`font-size-medium\` were replaced: colors are named by intended use on a theme-independent "dimmest → strongest" contrast scale, backgrounds by elevation (root → highest), and pixel-based tokens by their measure (\`font-size-14\`). The set shrank from 83 to 72 tokens even after adding line-height and border-width categories. Raw CSS variables, which let 30–50 typos slip through, were swapped for a typed Emotion \`vars\` object that gives autocomplete and errors on misspelled tokens.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Design systems](https://swe.quest/tags/design-systems.md) (Web & mobile)
- [CSS](https://swe.quest/tags/css.md) (Web & mobile)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)

## Prerequisites

- CSS custom properties ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))
- CSS-in-JS ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))

## Keywords

RUI, Replit, Emotion, Figma, design tokens

## Related posts

- [Theming the Zalando Design System](https://swe.quest/articles/theming-the-zalando-design-system-b14098d887a4b230.md): Zalando Engineering · 2024-05-13 · Medium · 20 min read · Design systems, Frontend, CSS, Mobile
  Zalando built theming into its design system by extracting repeated values into semantic design tokens (e.g. \`accent\` instead of \`orange\`) and adding component-level tokens that reference global ones, so themes can change a button's padding without redefining global scales.
- [How Thumbtack structures their design system](https://swe.quest/articles/how-thumbtack-structures-their-design-system-88dae4da18cdc3ea.md): Figma · 2023-07-13 · Medium · 8 min read · Design systems, Frontend, React, CSS
  Thumbtack's Thumbprint design system is organized in three layers: design tokens shared by web and native, an atomic CSS library built on the tokens, and accessible React components on top.
- [Illuminating dark mode](https://swe.quest/articles/illuminating-dark-mode-f998d746316f5fd8.md): Figma · 2022-07-21 · Medium · 15 min read · Design systems, CSS, Frontend, Refactoring & migrations, Accessibility
  Figma built dark mode by replacing roughly 5,100 build-time PostCSS color variables with runtime CSS custom properties based on a semantic token schema (Type | UI Element | Color role | Prominence | Interaction), so new themes only require reassigning token values.
- [The making of the Figma Pattern Library](https://swe.quest/articles/the-making-of-the-figma-pattern-library-500fd6e5ca81c90e.md): Figma · 2024-11-21 · Medium · 9 min read · Design systems, Frontend, Accessibility
  Figma rebuilt its fragmented internal design system as the Figma Pattern Library (FPL) ahead of the UI3 redesign, with a small team of designers and engineers working in a paired style.
- [An Introduction to the Zalando Design System](https://swe.quest/articles/an-introduction-to-the-zalando-design-system-4b3d34eb4aa32f29.md): Zalando Engineering · 2022-07-20 · Medium · 10 min read · Design systems, Frontend, React, CSS
  Zalando's web design system is layered on an extended atomic-design model: design tokens, "electrons" (a restricted CSS grammar like paddingTop\_m), atoms (the only layer that touches CSS), molecules (generic React components) and team-owned organisms.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
