Course contentsShow
← Web Development
Lesson 1332 of 2,98224. CSS Architecture and MaintainabilityFree lesson

The Settings Layer: Design Tokens and Variables

Define global variables, custom properties, and configuration values that cascade through your stylesheet.

The Settings Layer: Design Tokens and Variables

You'll learn: How to define foundational design values at the very top of your CSS architecture that cascade through your entire stylesheet.

What Are Design Tokens?

Think of design tokens like the ingredients list at the start of a recipe. Before you start cooking (styling), you gather all your core ingredients—your colors, spacing values, font families, and breakpoints—in one place. In CSS architecture, this is the Settings Layer, the absolute foundation of ITCSS.

Design tokens are named values that represent your design decisions. Instead of scattering #3B82F6 throughout 50 files, you define it once as --color-primary and reference it everywhere.

Defining Variables in the Settings Layer

This layer uses CSS custom properties (variables) to store configuration values:

/* settings.css - The foundation */
:root {
  /* Colors */
  --color-primary: #3B82F6;
  --color-secondary: #10B981;
  --color-text: #1F2937;
  
  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  
  /* Typography */
  --font-body: system-ui, sans-serif;
  --font-heading: Georgia, serif;
}

These values cascade down through every other layer. Change --color-primary once, and every component using it updates automatically.

Why This Matters

The Settings Layer contains no actual styles—just configuration. No selectors, no .class rules. Pure data. This separation means your design system becomes portable, maintainable, and consistent.

Key Takeaway: The Settings Layer defines global CSS variables and design tokens that serve as single sources of truth, cascading through your entire stylesheet without generating any CSS output themselves.