Customization

The New CSS is built on CSS custom properties (design tokens). Override them in your own stylesheet to change colors, spacing, typography, and more -- no build step required.

How to Override Tokens

Add a :root block in your own CSS after the library import. Because The New CSS uses @layer, your unlayered styles always win:

<link rel="stylesheet" href="the-new-css.min.css"> <style> :root { --color-blue-500: oklch(0.65 0.25 250); --font-sans: "Inter", system-ui, sans-serif; --spacing-4: 1.25rem; } </style>

Color Tokens

All colors use the oklch() color space for perceptual uniformity. Override any token to rebrand your project.

Gray Scale

TokenDefault
--color-gray-50oklch(0.985 0 0)
--color-gray-100oklch(0.97 0.001 260)
--color-gray-200oklch(0.92 0.004 260)
--color-gray-300oklch(0.87 0.006 260)
--color-gray-400oklch(0.71 0.01 260)
--color-gray-500oklch(0.55 0.014 260)
--color-gray-600oklch(0.45 0.014 260)
--color-gray-700oklch(0.37 0.013 260)
--color-gray-800oklch(0.27 0.01 260)
--color-gray-900oklch(0.21 0.008 260)
--color-gray-950oklch(0.13 0.005 260)

Brand Colors

TokenDefault
--color-blue-50oklch(0.97 0.014 250)
--color-blue-100oklch(0.93 0.034 250)
--color-blue-500oklch(0.59 0.2 255)
--color-blue-600oklch(0.52 0.2 260)
--color-blue-700oklch(0.45 0.18 260)
--color-red-50 / 500 / 600Red tones (hue 20-25)
--color-green-50 / 500 / 600Green tones (hue 150-155)
--color-yellow-50 / 500 / 600Yellow tones (hue 65-95)
--color-purple-50 / 500 / 600Purple tones (hue 295-300)
--color-pink-500oklch(0.59 0.2 345)
--color-orange-500oklch(0.7 0.19 40)
--color-teal-500oklch(0.59 0.14 180)
--color-whiteoklch(1 0 0)
--color-blackoklch(0 0 0)

Adding a Custom Brand Color

Override the blue tokens to rebrand the primary color across all utilities:

:root { /* Rebrand to indigo */ --color-blue-50: oklch(0.97 0.02 280); --color-blue-100: oklch(0.93 0.04 280); --color-blue-500: oklch(0.55 0.25 280); --color-blue-600: oklch(0.48 0.25 280); --color-blue-700: oklch(0.40 0.22 280); }

Spacing Tokens

Spacing tokens control padding, margin, and gap utilities. Values follow a 4px base scale.

TokenDefaultPixels
--spacing-00px0
--spacing-px1px1
--spacing-0-50.125rem2
--spacing-10.25rem4
--spacing-20.5rem8
--spacing-30.75rem12
--spacing-41rem16
--spacing-51.25rem20
--spacing-61.5rem24
--spacing-82rem32
--spacing-102.5rem40
--spacing-123rem48
--spacing-164rem64
--spacing-205rem80
--spacing-246rem96

Typography Tokens

Font Families

TokenDefault
--font-sanssystem-ui, -apple-system, "Segoe UI", Roboto, sans-serif
--font-serifGeorgia, Cambria, "Times New Roman", Times, serif
--font-monoui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace

Font Sizes

TokenDefaultPixels
--text-xs0.75rem12px
--text-sm0.875rem14px
--text-base1rem16px
--text-lg1.125rem18px
--text-xl1.25rem20px
--text-2xl1.5rem24px
--text-3xl1.875rem30px
--text-4xl2.25rem36px

Font Weights, Line Heights & Letter Spacing

TokenDefault
--font-light300
--font-normal400
--font-medium500
--font-semibold600
--font-bold700
--font-extrabold800
--leading-none ... --leading-loose1 / 1.25 / 1.375 / 1.5 / 1.625 / 2
--tracking-tight / normal / wide-0.025em / 0em / 0.025em

Examples

Changing the Font

Load a Google Font and assign it to the sans-serif token:

<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"> <style> :root { --font-sans: "Inter", system-ui, sans-serif; } </style>

Tighter Spacing Scale

Reduce the larger spacing values for a more compact layout:

:root { --spacing-8: 1.75rem; /* was 2rem */ --spacing-12: 2.5rem; /* was 3rem */ --spacing-16: 3.5rem; /* was 4rem */ --spacing-20: 4.25rem; /* was 5rem */ --spacing-24: 5rem; /* was 6rem */ }

Live: Custom Brand Color Override

The card below uses a scoped custom property override to change the blue accent to purple within a single container:

Purple-branded card

The button below uses the standard bg-blue-600 class, but the token has been overridden to purple on this container.

Purple Action
<div style="--color-blue-500: oklch(0.59 0.2 295); --color-blue-600: oklch(0.52 0.2 295);" class="p-6 bg-gray-50 border border-gray-200 rounded-lg"> <h4 class="font-semibold">Purple-branded card</h4> <p class="text-gray-600 text-sm">Token overridden to purple.</p> <a class="inline-block px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium"> Purple Action </a> </div>