Skip to content

Design Tokens

All tokens are CSS custom properties defined in :root (dark RPG theme, dark-first).
Values use HSL channels (no hsl() wrapper in the variable) so they can be composed via Tailwind's @theme inline.


Semantic Colors

CSS VariableHSL ValuePurpose
--background20 15% 8%Page / app background
--foreground40 30% 90%Default text color
--card20 15% 12%Card / surface background
--card-foreground40 30% 90%Text on cards
--popover20 15% 10%Popovers, dropdowns background
--popover-foreground40 30% 90%Text in popovers
--primary38 70% 50%Golden amber — buttons, highlights
--primary-foreground20 15% 8%Text on primary backgrounds
--secondary20 15% 18%Subtle surfaces, secondary buttons
--secondary-foreground40 30% 90%Text on secondary
--muted20 10% 20%Muted backgrounds (tags, chips)
--muted-foreground40 15% 60%Placeholder / secondary text
--accent38 70% 50%Same as primary (accent highlights)
--accent-foreground20 15% 8%Text on accent backgrounds
--destructive0 84.2% 60.2%Danger / delete actions
--destructive-foreground210 40% 98%Text on destructive backgrounds
--border20 15% 20%Default border color
--input20 15% 15%Input field background
--ring38 70% 50%Focus ring color
--glow38 70% 50%RPG glow effect (box-shadow)

Border Radius

CSS VariableComputed ValueTailwind class
--radius0.5rembase
--radius-smcalc(var(--radius) - 4px)rounded-sm
--radius-mdcalc(var(--radius) - 2px)rounded-md
--radius-lgvar(--radius)rounded-lg
--radius-xlcalc(var(--radius) + 4px)rounded-xl

CSS VariablePurpose
--sidebarSidebar background
--sidebar-foregroundSidebar text
--sidebar-primarySidebar active/primary color
--sidebar-primary-foregroundText on sidebar primary
--sidebar-accentSidebar hover state
--sidebar-accent-foregroundText on sidebar accent
--sidebar-borderSidebar separator
--sidebar-ringSidebar focus ring

Chart Tokens

CSS VariableHSL ValueUsage
--chart-138 70% 50%Golden amber
--chart-2142 70% 45%Nature green
--chart-3200 70% 50%Arcane blue
--chart-4280 60% 55%Mystic purple
--chart-50 70% 55%Blood red

Typography

The library declares two font families without loading them. Opt in via @import "@franksauvag/rpg-commons/fonts":

FontUsageCSS
Cinzelh1h6, display textfont-family: "Cinzel", serif
Crimson TextBody copy, body defaultfont-family: "Crimson Text", serif

Overriding Tokens

Override any token in your consuming app's CSS file after the lib import:

css
@import "@franksauvag/rpg-commons/style";
@import "tailwindcss";

/* Example: shift primary to a cooler blue for a nautical theme */
:root {
  --primary: 210 70% 55%;
  --ring: 210 70% 55%;
  --glow: 210 70% 55%;
}

To add a light mode, add a .light or [data-theme="light"] class override:

css
.light {
  --background: 40 30% 96%;
  --foreground: 20 15% 12%;
  --card: 40 20% 92%;
  --card-foreground: 20 15% 12%;
  /* ...other tokens */
}

Tailwind Utilities

Because tokens are mapped via @theme inline, all standard Tailwind color utilities resolve automatically:

html
<div class="bg-primary text-primary-foreground">Golden button</div>
<div class="bg-card border border-border">Card surface</div>
<p class="text-muted-foreground">Subtitle text</p>