zudo-doc

Type to search...

to open search from anywhere

EN/JA/DE

Design System

CreatedMar 11, 2026UpdatedMar 11, 2026Takeshi Takatsudo

zudo-doc's tight token strategy — spacing, typography, colors, and more.

zudo-doc uses a tight token strategy — instead of importing the full Tailwind framework, only preflight and utilities are loaded, skipping the default theme entirely. A small, intentional set of design tokens is defined from scratch. This page covers the full system: spacing, typography, colors, border radius, and breakpoints.

Tight Token Strategy

Tailwind CSS ships with hundreds of built-in values — colors, spacing scales, font sizes, and more. In a themeable project, these defaults cause problems: hardcoded values ignore theme changes and create inconsistency.

zudo-doc solves this with selective imports in src/styles/global.css — only preflight (reset) and utilities (functional classes) are imported, while the default theme layer is skipped entirely:

@import "tailwindcss/preflight";
@import "tailwindcss/utilities";

@theme {
  /* Only define what we need — no resets necessary */
  --color-bg: var(--zd-bg);
  --color-fg: var(--zd-fg);
  /* ... */
}

Because the default theme is never loaded, no --*: initial reset block is needed. Only explicitly defined tokens in @theme work. Using an undefined token (like p-4 or bg-gray-500) produces no effect — the value simply doesn’t exist. This gives you a guarantee: invalid tokens cause build errors or missing styles, not visual bugs.

ℹ️ Info

This is the core philosophy: define only what the project needs. Every value in the system is intentional, and accidental use of Tailwind defaults is immediately visible.

Spacing

zudo-doc separates spacing into two axes: horizontal (hsp) and vertical (vsp). They serve different purposes in layout — horizontal spacing controls inline rhythm and gutters, while vertical spacing controls content flow and section separation. The vertical scale is stretched at larger sizes to give content more breathing room.

Horizontal Spacing (hsp)

TokenValueExample Class
hsp-2xs0.25rem (4px)px-hsp-2xs
hsp-xs0.375rem (6px)px-hsp-xs
hsp-sm0.5rem (8px)gap-x-hsp-sm
hsp-md0.75rem (12px)px-hsp-md
hsp-lg1rem (16px)px-hsp-lg
hsp-xl1.5rem (24px)px-hsp-xl
hsp-2xl2rem (32px)px-hsp-2xl

Vertical Spacing (vsp)

TokenValueExample Class
vsp-2xs0.25rem (4px)py-vsp-2xs
vsp-xs0.5rem (8px)py-vsp-xs
vsp-sm0.75rem (12px)gap-y-vsp-sm
vsp-md1rem (16px)py-vsp-md
vsp-lg1.5rem (24px)py-vsp-lg
vsp-xl2rem (32px)py-vsp-xl
vsp-2xl3rem (48px)py-vsp-2xl

Both axes also include 0 (0px) and px (1px) utility values.

<!-- Horizontal padding + vertical padding -->
<div class="px-hsp-lg py-vsp-md">Content with asymmetric spacing</div>

<!-- Grid with dual-axis gaps -->
<div class="grid gap-x-hsp-md gap-y-vsp-lg">Grid items</div>

💡 Tip

Notice that hsp-lg is 1rem while vsp-lg is 1.5rem — the vertical axis is stretched at larger sizes. This is intentional — vertical flow needs more room than horizontal rhythm.

Typography

Font Sizes

TokenValueExample
caption0.75rem / 12pxtext-caption
small0.875rem / 14pxtext-small
body1rem / 16pxtext-body
subheading1.125rem / 18pxtext-subheading
heading1.875rem / 30pxtext-heading
display3.75rem / 60pxtext-display

Font Weights

TokenValueExample
normal400font-normal
medium500font-medium
semibold600font-semibold
bold700font-bold

Line Heights

TokenValueExample
tight1.25leading-tight
snug1.375leading-snug
normal1.5leading-normal
relaxed1.625leading-relaxed

Font Families

TokenStackExample
sansSystem sans-serif stackfont-sans
monoSystem monospace stackfont-mono
<h1 class="text-heading font-bold leading-tight">Page Title</h1>
<p class="text-body font-normal leading-normal">Body text</p>
<code class="text-small font-mono">inline code</code>

Border Radius

TokenValueExample
DEFAULT0.25rem (4px)rounded
lg0.5rem (8px)rounded-lg
full9999pxrounded-full
<button class="rounded bg-accent text-bg">Default radius</button>
<div class="rounded-lg bg-surface">Card with larger radius</div>
<span class="rounded-full bg-muted">Pill badge</span>

Breakpoints

TokenValueExample
sm640pxsm:flex
lg1024pxlg:grid-cols-2
xl1280pxxl:max-w-5xl
<div class="px-hsp-sm sm:px-hsp-md lg:px-hsp-lg xl:px-hsp-xl">
  Responsive horizontal padding
</div>

Colors

Colors use a three-tier strategy: raw palette values (Tier 1) flow into semantic tokens (Tier 2), which feed into component-scoped tokens (Tier 3). Each tier only references the tier above it, so swapping a color scheme updates the entire site at once.

See the Color guide for full details on the color token system, color schemes, and customization.

Usage Rules

⚠️ Tailwind defaults are disabled

The default Tailwind theme is not imported — only tailwindcss/preflight and tailwindcss/utilities are loaded. Only project-defined tokens work.

Do

<!-- Semantic color tokens -->
<p class="text-fg">Primary text</p>
<div class="bg-surface border border-muted">Panel</div>
<a class="text-accent hover:text-accent-hover">Link</a>

<!-- Spacing tokens -->
<div class="px-hsp-lg py-vsp-md">Proper spacing</div>
<div class="gap-x-hsp-sm gap-y-vsp-md">Grid gaps</div>

<!-- Typography tokens -->
<h2 class="text-subheading font-semibold leading-tight">Heading</h2>

Don’t

<!-- DON'T: Tailwind defaults — not defined and produce nothing -->
<div class="p-4 bg-gray-500 text-sm">Broken</div>

<!-- DON'T: Hardcoded hex — breaks theming -->
<div class="bg-[#1e1e2e] text-[#f8f8f2]">Breaks on theme switch</div>

All tokens are defined in src/styles/global.css. That file is the single source of truth for the design system.