Skip to main content
Django Unfold uses a comprehensive color system based on OKLCH color space, providing consistent and accessible color palettes for your admin interface.

Color configuration

Customize colors through the COLORS setting in your UNFOLD configuration:
settings.py
UNFOLD = {
    "COLORS": {
        "primary": {
            "50": "oklch(97.7% .014 308.299)",
            "100": "oklch(94.6% .033 307.174)",
            # ... more shades
        },
    },
}

Color structure

COLORS
object
Complete color system configuration using OKLCH color space.

OKLCH color space

Unfold uses the OKLCH color space for consistent and perceptually uniform colors. OKLCH provides:
  • Perceptual uniformity across lightness values
  • Better color manipulation and interpolation
  • Consistent contrast ratios
  • Wide color gamut support

OKLCH format

oklch(lightness% chroma hue)
  • Lightness: 0-100%, controls brightness
  • Chroma: 0-0.4+, controls color intensity
  • Hue: 0-360, controls color angle

Customizing colors

Custom primary color

settings.py
UNFOLD = {
    "COLORS": {
        "primary": {
            "50": "oklch(98% .01 150)",
            "100": "oklch(95% .02 150)",
            "200": "oklch(90% .04 150)",
            "300": "oklch(83% .08 150)",
            "400": "oklch(72% .15 150)",
            "500": "oklch(64% .20 150)",
            "600": "oklch(56% .22 150)",
            "700": "oklch(48% .20 150)",
            "800": "oklch(40% .16 150)",
            "900": "oklch(33% .12 150)",
            "950": "oklch(25% .10 150)",
        },
    },
}

Custom font colors

settings.py
UNFOLD = {
    "COLORS": {
        "font": {
            "subtle-light": "oklch(60% .01 250)",
            "subtle-dark": "oklch(70% .01 250)",
            "default-light": "oklch(40% .02 250)",
            "default-dark": "oklch(85% .02 250)",
            "important-light": "oklch(20% .03 250)",
            "important-dark": "oklch(95% .03 250)",
        },
    },
}

Using CSS variables

Font colors can reference other color variables:
settings.py
UNFOLD = {
    "COLORS": {
        "font": {
            "subtle-light": "var(--color-base-500)",
            "default-light": "var(--color-primary-700)",
        },
    },
}

Color tools

To generate OKLCH color palettes:
Start with your brand color in the 500 shade and adjust lightness and chroma for other shades while keeping the hue consistent.
When customizing colors, ensure sufficient contrast ratios for accessibility. Test your colors in both light and dark themes.

Build docs developers (and LLMs) love