Example Brand Themes (`themes/example-brand.css`)
This file demonstrates how to implement brand-specific color themes using the framework's color system. It provides three example brand palettes that can be app
This file demonstrates how to implement brand-specific color themes using the framework’s color system. It provides three example brand palettes that can be applied via data attributes.
Overview
The file defines brand themes by setting core color variables that drive the entire design system. Each brand establishes:
- Primary accent color (HSL values)
- Hue shifts for secondary and tertiary colors
- Optional dark mode adjustments
Brand Themes
Ocean Theme
A cool, professional blue-based brand.
Data Attribute: data-theme="ocean"
Color Variables:
--accent-h: 200(Blue hue)--accent-c: 0.16(16% chroma)--accent-l: 60%(60% lightness)--secondary-hue-shift: 40(Warmer secondary colors)--tertiary-hue-shift: -80(Cooler tertiary colors)
Dark Mode Adjustments:
--accent-c: 0.20(Increased chroma for better contrast)--accent-l: 70%(Lighter for dark backgrounds)
Sunrise Theme
A warm, energetic orange-based brand.
Data Attribute: data-theme="sunrise"
Color Variables:
--accent-h: 30(Orange hue)--accent-c: 0.18(18% chroma)--accent-l: 62%(62% lightness)--secondary-hue-shift: 60(More saturated secondary)--tertiary-hue-shift: -90(Deep blue tertiary)
Dark Mode Adjustments:
--accent-c: 0.22(Increased chroma)--accent-l: 72%(Lighter)
Forest Theme
A natural, green-based brand.
Data Attribute: data-theme="forest"
Color Variables:
--accent-h: 145(Green hue)--accent-c: 0.16(16% chroma)--accent-l: 58%(58% lightness)--secondary-hue-shift: 50(Yellow-green secondary)--tertiary-hue-shift: -100(Purple tertiary)
Dark Mode Adjustments:
--accent-c: 0.18(Slightly increased chroma)--accent-l: 68%(Lighter)
Usage
Apply themes globally by setting the data attribute on the root element:
<html data-theme="ocean"> <!-- Ocean-themed application --></html>Or apply to specific sections:
<div data-theme="sunrise"> <!-- Sunrise-themed section --></div>How It Works
These variables feed into the color generation system defined in core/palette.css. The framework automatically generates:
- Full color scales from these base values
- Semantic color tokens (
--theme-primary,--theme-secondary, etc.) - Feedback colors (success, warning, error)
- Interactive states (hover, focus, active)
Dark Mode Support
The file includes automatic dark mode adjustments using prefers-color-scheme: dark. These tweaks ensure brand colors remain vibrant and accessible in dark themes.
Customization
To create your own brand theme:
- Choose your primary accent color in HSL
- Set appropriate chroma and lightness values
- Define hue shifts for secondary/tertiary colors
- Test in both light and dark modes
- Add dark mode adjustments if needed
Browser Support
- Data attributes work in all browsers
- CSS custom properties work in all modern browsers
prefers-color-schemeworks in modern browsers with fallback
Integration Notes
- Import this file after
core/palette.cssto override defaults - Combine with
themes/theme-packs.cssfor additional theme variations - Use with
core/theme.cssfor component-specific theming
Related Files
core/palette.css: Core color generation systemthemes/theme-packs.css: Additional theme variationscore/theme.css: Component theme overrides