Foundations
Color System
The semantic color system provides 11 purpose-driven colors. Each color resolves to a full palette of CSS classes for surfaces, borders, text, focus rings, and component-specific slots via the ColorPaletteRegistry.
Overview
The color system is built around 11 semantic colors, each with a specific purpose. Instead of raw hex or RGB values, components consume colors through the Color enum. The framework then resolves each color to the correct CSS classes for every variant and context.
This approach ensures consistency: changing a color definition in one place updates every component that uses it. The underlying values use OKLCH for perceptually uniform shade palettes that look correct across light and dark modes.
Live Color Swatches
All 11 colors rendered as live Button components in each of the 3 variants: Filled, Outlined, and Text. These are real components using the actual color system.
Filled
Primary
Secondary
Light
Dark
Neutral
Disabled
Info
Warning
Error
Success
Link
Bg
Panel
PanelMuted
Hero
Outlined
Primary
Secondary
Light
Dark
Neutral
Disabled
Info
Warning
Error
Success
Link
Bg
Panel
PanelMuted
Hero
Text
Primary
Secondary
Light
Dark
Neutral
Disabled
Info
Warning
Error
Success
Link
Bg
Panel
PanelMuted
Hero
Semantic Meaning
Each color has a defined semantic purpose. Use the right color for the right context to keep the UI consistent and accessible.
| Color | Purpose | Typical Usage |
|---|---|---|
| Primary | Brand accent, primary call-to-action | Main submit buttons, highlighted navigation, key visual elements |
| Secondary | Supporting actions, secondary emphasis | Cancel buttons, auxiliary actions, muted labels |
| Light | Light-toned surfaces and controls | Cards in light mode, subtle backgrounds, form containers |
| Dark | High-contrast, dark-toned elements | Dark headers, footer sections, inverted panels |
| Neutral | Chrome-free, baseline tone | Dividers, borders, background panels, skeleton loaders |
| Disabled | Visually disabled / inactive state | Greyed-out buttons, unavailable options, read-only indicators |
| Info | Informational, non-critical feedback | Info alerts, tooltips, help badges, informational banners |
| Warning | Caution, requires attention | Warning alerts, validation hints, expiration notices |
| Error | Error, destructive or invalid | Error messages, delete confirmations, form validation errors |
| Success | Positive outcome, confirmation | Success alerts, completed steps, saved confirmations |
| Link | Navigational, hyperlink-like | Inline links, text buttons for navigation, breadcrumb active items |
ColorPaletteRegistry
The ColorPaletteRegistry.Resolve(Color) method returns a ColorPalette record with 56 CSS class properties. Components use this internally to map a Color enum value to the correct Tailwind classes for every variant and context.
Show code
Copy code
// Internal usage — components resolve their color classes via the registry
var palette = ColorPaletteRegistry.Resolve(Color.Primary);
// Each property returns ready-to-use Tailwind CSS class strings
// e.g. palette.FilledButtonClasses → "border-... bg-[var(--ui-color-primary-filled-bg)] text-..."
// e.g. palette.BorderOutlined → "border-app-border-strong"
// e.g. palette.TextOnFilled → "text-[var(--ui-color-primary-filled-text)] ..."The 56 properties are grouped by category. Each property contains ready-to-use CSS class strings that include background, border, text color, hover states, and dark mode overrides.
| Category | Properties |
|---|---|
| Buttons | FilledButtonClasses, OutlinedButtonClasses, TextButtonClasses |
| Badges | FilledBadgeClasses, OutlinedBadgeClasses, TextBadgeClasses |
| Component-specific | AlertClasses, TooltipClasses, MenuItemClasses, EmptyStateClasses, ProgressBarClasses, TimelineDotClasses, StepperStepClasses |
| Surfaces | OutlinedBg, TextBg, SurfaceOutlined, SurfaceFilled, ReadOnlySurface |
| Borders | BorderOutlined, BorderFilled, BorderLine |
| Focus rings | FocusRingOutlined, FocusRingLine |
| Text & placeholders | TextOnFilled, TextOnOutlinedOrText, PlaceholderOnFilled, PlaceholderOnOutlined |
| Input adornments | AdornmentOnFilled, ActionOnFilled |
| Panels (Modal, Drawer) | PanelFilledSurface, PanelFilledText, PanelOutlinedBorder |
| Cards | CardFilledText, CardOutlinedText, CardTextVariantText, CardFilledBorder, CardOutlinedBorder, CardTextBorder |
CSS Custom Properties
All color values are defined as CSS custom properties following a consistent naming pattern. Variant-specific properties (filled, outlined, text) reference the underlying shade palette.
Show code
Copy code
/* Naming pattern for CSS custom properties */
--ui-color-{colorname}-{variant}-{type}
/* Examples */
--ui-color-primary-filled-bg
--ui-color-primary-filled-text
--ui-color-primary-filled-border
--ui-color-primary-outlined-bg
--ui-color-primary-outlined-text
--ui-color-primary-outlined-border
--ui-color-primary-text-bg
--ui-color-primary-text-text
--ui-color-primary-text-border
/* Dark mode suffix */
--ui-color-primary-filled-bg-dark
--ui-color-primary-outlined-bg-darkEach color defines a tonal shade palette with 11 steps from 50 (lightest) to 950 (darkest). Shades are generated using a perceptually uniform tone scale, meaning each step looks evenly spaced to the human eye regardless of hue.
| Shade Step | Description |
|---|---|
| 50 | Light, used for outlined-variant backgrounds |
| 100 | Light accent, hover states on light surfaces |
| 200 | Soft accent |
| 300 | Medium-light, borders on light backgrounds |
| 400 | Medium, secondary text on light backgrounds |
| 500 | Base shade, used for filled-variant backgrounds |
| 600 | Slightly darker than base, hover on filled |
| 700 | Dark accent |
| 800 | Very dark, text on light backgrounds |
| 900 | Near-black accent |
| 950 | Deep dark, dark-mode surfaces |
Show code
Copy code
/* Tonal shade palette — each color defines 11 shades from 50 (lightest) to 950 (darkest) */
--ui-color-primary-50: /* Tone 95 — very light tint */
--ui-color-primary-100: /* Tone 90 */
--ui-color-primary-200: /* Tone 80 */
--ui-color-primary-300: /* Tone 70 */
--ui-color-primary-400: /* Tone 60 */
--ui-color-primary-500: /* Tone 50 — perceptual midpoint */
--ui-color-primary-600: /* Tone 40 */
--ui-color-primary-700: /* Tone 30 */
--ui-color-primary-800: /* Tone 20 */
--ui-color-primary-900: /* Tone 10 */
--ui-color-primary-950: /* Tone 5 — very dark shade */
/* Used in variant variables */
--ui-color-primary-filled-bg: /* resolved from shade config (e.g. shade 300) */
--ui-color-primary-outlined-bg: /* resolved from shade config (e.g. shade 100) */Palette Generation
Each seed color in the theme produces a palette of 11 shades. The palette is generated algorithmically using a perceptually uniform tone scale: the seed color's hue is preserved across all shades while the lightness is set to specific target tones.
The algorithm extracts hue and chroma from the seed color, then creates 11 shades by setting the tone (perceptual lightness on a 0-100 scale) to fixed target values. Chroma is automatically adjusted at the extremes to keep colors within the sRGB gamut.
| Shade | Tone | Character |
|---|---|---|
| 50 | 95 | Very light tint, backgrounds |
| 100 | 90 | Light tint, hover states |
| 200 | 80 | Soft accent |
| 300 | 70 | Medium-light, filled backgrounds |
| 400 | 60 | Medium, borders |
| 500 | 50 | Perceptual midpoint |
| 600 | 40 | Medium-dark, text on light surfaces |
| 700 | 30 | Dark accent |
| 800 | 20 | Very dark, strong text |
| 900 | 10 | Near-black accent |
| 950 | 5 | Deepest shade, dark-mode surfaces |
The gamut mapping ensures all generated colors are valid sRGB values. For very vivid seed colors, the chroma is reduced at extreme tones (very light or very dark) to prevent out-of-gamut colors.
Live Preview: Primary Color Palette
File Reference
The color system is implemented across these files in the Sillium.Core.Blazor project.
| File | Purpose |
|---|---|
| Models/Color.cs | Color enum with 11 semantic values (Primary, Secondary, Light, Dark, Neutral, Disabled, Info, Warning, Error, Success, Link) |
| Internal/ColorPalette.cs | ColorPaletteRegistry with Resolve(Color) method returning a 56-property ColorPalette record |
| Styles/app.css | CSS custom properties defining the OKLCH shade palette and Tailwind theme mapping |