Design system / Tenant themes
CreativeXHub design system
Tenant themes
Production console presets and custom palette derivation, with explicit preview and publication boundaries.
Production theme catalog
Console themes override semantic CSS variables through getTenantThemeStyle and getCustomThemeStyle. These specimens compose those functions with getColorModeThemeStyle, exactly as the console does. Each of seven light presets has a named dark preset with layered charcoal surfaces. Tenants choose the two appearances independently. These examples pair each family for comparison and do not read tenant configuration or a session.
Actual catalog and custom-palette functions; local candidate values only.
Slate
The neutral CreativeXHub console palette. Switch the documentation appearance to preview Slate Dark.
Production semantic roles with local values. Tenant settings are not read or changed.
Supporting text on the preset's muted surface.
--primaryoklch(0.205 0 0)--secondaryoklch(0.97 0 0)--accentoklch(0.97 0 0)
Ocean
A high-contrast blue palette with cool supporting surfaces. Switch the documentation appearance to preview Ocean Dark.
Production semantic roles with local values. Tenant settings are not read or changed.
Supporting text on the preset's muted surface.
--primaryoklch(0.42 0.16 250)--secondaryoklch(0.94 0.025 240)--accentoklch(0.91 0.045 220)
Orchid
A high-contrast violet palette with warm, restrained accents. Switch the documentation appearance to preview Orchid Dark.
Production semantic roles with local values. Tenant settings are not read or changed.
Supporting text on the preset's muted surface.
--primaryoklch(0.42 0.17 310)--secondaryoklch(0.95 0.025 320)--accentoklch(0.92 0.055 340)
Ember
A restrained orange palette with softly tinted surfaces. Switch the documentation appearance to preview Ember Dark.
Production semantic roles with local values. Tenant settings are not read or changed.
Supporting text on the preset's muted surface.
--primaryoklch(0.43 0.14 45)--secondaryoklch(0.94 0.018 45)--accentoklch(0.91 0.035 45)
Ruby
A restrained red palette with softly tinted surfaces. Switch the documentation appearance to preview Ruby Dark.
Production semantic roles with local values. Tenant settings are not read or changed.
Supporting text on the preset's muted surface.
--primaryoklch(0.43 0.17 25)--secondaryoklch(0.94 0.018 25)--accentoklch(0.91 0.035 25)
Amber
A restrained yellow palette with softly tinted surfaces. Switch the documentation appearance to preview Amber Dark.
Production semantic roles with local values. Tenant settings are not read or changed.
Supporting text on the preset's muted surface.
--primaryoklch(0.43 0.1 90)--secondaryoklch(0.94 0.018 90)--accentoklch(0.91 0.035 90)
Forest
A restrained green palette with softly tinted surfaces. Switch the documentation appearance to preview Forest Dark.
Production semantic roles with local values. Tenant settings are not read or changed.
Supporting text on the preset's muted surface.
--primaryoklch(0.43 0.12 150)--secondaryoklch(0.94 0.018 150)--accentoklch(0.91 0.035 150)
Custom palette derivation
This example calls getCustomThemeStyle, normalizeCustomPalette and isCustomPaletteAccessible. In the light derivation, secondary and accent are normalized; destructive, success and warning retain preset values. This specimen pairs independent custom light and dark palettes. Tenants save each three-color slot separately. Foreground polarity is selected by contrast comparison, not a primary-lightness threshold. Changes affect this local specimen only. The contrast result covers the function's specified pairs, not every rendered combination.
Normalized: #2454a6Normalized: #d6eeffNormalized: #eefcffPasses the current publication contrast checks.
Custom dark colors
Dark colors pass the current publication contrast checks.
Production semantic roles with local values. Tenant settings are not read or changed.
Supporting text on the preset's muted surface.
Browser mode and tenant branding
Every logged-in account menu offers one Appearance row with Light and Dark. Open the menu with Enter or Space, use arrow keys to move, and select with Enter or Space. Escape closes the menu and returns focus. The selected radio item exposes its checked state. Both modes use the same authorized navigation and Sign out destination.
The root ColorModeProvider uses next-themes to remember the choice in this browser under cxh-color-mode, including after reload. It defaults to light and does not follow the operating-system preference. If storage is unavailable, switching still works but reload persistence is unavailable. Mode does not save a tenant palette or change permission. Documentation previews are temporary and leave the saved product preference unchanged.
Theme ownership
The authorized server commits each setting with its completion evidence. If audit delivery is delayed after commit, the save remains successful. A later save to that record must deliver its prior evidence first. This public reference does not save settings or run recovery.
docs/decisions/ADR-0113-atomic-theme-setting-audit-evidence.mdsrc/app/globals.css imports the base theme. The console server layout resolves both tenant selections and applies the production theme style to its outer wrapper. Descendant components inherit these CSS variables. The theme store checks the tenant selection before the global selection independently per mode and uses Slate or Slate Dark when configuration is unavailable. Existing selections remain light selections. A selected custom light theme without a stored palette renders Slate. A missing custom dark palette renders Slate Dark.
Repository path: src/app/(tenants)/console/layout.tsx
Repository path: src/lib/domains/console/themeSettings/repositories/themeSelectionRepository.ts
Authorized product routes load the selected preset or saved custom palette and supply it to the console. Shared components consume semantic roles without reading tenant settings. Preview changes remain local; saving and publication require the product's authorized operation.
How three selected colors become a palette
getCustomThemeStyle starts with the default console preset and overrides related light-mode semantic roles from primary, secondary and accent inputs. Primary is retained. Secondary and accent are normalized in OKLCH before being used for light surfaces and related roles. The separate mode-composition function preserves these values in light mode. Dark mode uses a separately saved three-color palette or an approved preset. Foreground selection compares actual contrast, not a lightness threshold. Backgrounds and text remain platform-controlled; there is no fourth editable color or unrestricted token editor.
| Selection | What happens | Where it reaches |
|---|---|---|
| Primary | Retains the selected color and derives a contrasting foreground. | Primary actions, links, focus, information feedback, sidebar emphasis and chart one. |
| Secondary | Light: OKLCH lightness 0.94 with chroma capped at 0.15. Dark: lightness 0.31 with chroma capped at 0.025. Both retain hue direction. | Secondary, muted and sunken surfaces; related derivations also supply borders and sidebar surfaces. |
| Accent | Light: OKLCH lightness 0.985 with chroma capped at 0.15. Dark: lightness 0.36 with chroma capped at 0.05. Both retain hue direction. | Accent, selected and sidebar-accent roles. |