โ† Back to Blog

Color Naming Conventions in Design Systems

2026-04-20 ยท 5 min read

โ† Back to Blog

Color Naming Conventions in Design Systems

ยท 6 min read

Why Color Naming Matters

A good color variable naming system is the cornerstone of design system maintainability. When you use HEX values directly (like #4A90E2) without naming them, changing a brand color means globally replacing that value throughout the codebase, with no way to understand the color's purpose from the code. A good naming system makes color intent self-documenting and makes theme switching and brand updates easy.

Three Primary Naming Strategies

Color variable naming primarily uses three strategies, each with pros and cons:

Implementing a Two-Tier Naming System

The two-tier naming system is currently the most recommended approach: the first tier (palette layer) defines all available color values; the second tier (semantic layer) references the first tier and assigns semantic meaning:

/* Tier 1: Color palette (raw values) */
:root {
  --blue-100: hsl(214, 80%, 92%);
  --blue-500: hsl(214, 80%, 52%);
  --blue-700: hsl(214, 80%, 35%);
  --blue-900: hsl(214, 80%, 18%);

  --gray-50:  hsl(220, 15%, 98%);
  --gray-800: hsl(220, 15%, 20%);
}

/* Tier 2: Semantic tokens */
:root {
  --color-primary:        var(--blue-500);
  --color-primary-hover:  var(--blue-700);
  --color-primary-subtle: var(--blue-100);
  --color-bg:             var(--gray-50);
  --color-text:           var(--gray-800);
}

/* Usage in components */
.btn-primary {
  background: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
}

Naming Practices from Major Design Systems

Different major design systems have different naming conventions โ€” understanding them helps make more informed choices:

Best Practices for Naming Conventions

Best Practices for SCSS Color Variables

// SCSS: Two-tier color system

// === Tier 1: Color palette ===
$blue-50:   #EFF6FF;
$blue-500:  #3B82F6;
$blue-600:  #2563EB;
$blue-700:  #1D4ED8;

// === Tier 2: Semantic tokens ===
$color-primary:          $blue-500;
$color-primary-hover:    $blue-600;
$color-primary-active:   $blue-700;
$color-primary-focus-ring: rgba($blue-500, 0.4);

// === Component-level tokens ===
$btn-primary-bg:         $color-primary;
$btn-primary-bg-hover:   $color-primary-hover;
$btn-primary-text:       #ffffff;

Migrating to CSS Custom Properties

If your project currently uses SCSS color variables, consider gradually migrating to CSS custom properties (CSS variables). The main advantage of CSS variables is that they can be changed at runtime (like theme switching), which SCSS variables cannot do. For migration: first replace the semantic tier with CSS variables while keeping SCSS variables as raw color values, then gradually update component styles from SCSS variables to CSS variables.

Try the online tool now โ€” no installation, completely free.

Open Tool โ†’

Try the free tool now

Use Free Tool โ†’