Skip to main content
Version: v1 (Current)

CSS Variables Reference

Complete reference of all CSS variables used by the UI Kit.

Default Theme Values

:root {
/* ===== Core Platform Variables ===== */

/* Page */
--page_background_color: #000466;
--page_text_color: #FFFFFF;

/* Input Fields */
--input_field_background_color: #03054a;
--input_field_text_color: #FFFFFF;
--input_field_border_color: #888C92;

/* Primary Button */
--primary_button_background_color: #FFFFFF;
--primary_button_text_color: #000596;
--primary_button_border_color: #FFFFFF;

/* Secondary Button */
--secondary_button_background_color: #000466;
--secondary_button_text_color: #FFFFFF;
--secondary_button_border_color: #FFFFFF;

/* Tertiary Button */
--tertiary_button_background_color: transparent;
--tertiary_button_text_color: #FFFFFF;
--tertiary_button_border_color: transparent;

/* Spinner */
--spinner_background_color: #03054A;
--spinner_color: #FFFFFF;

/* Modal */
--modal_background_color: #FFFFFF;
--modal_text_color: #222222;
--modal_primary_button_background_color: #000596;
--modal_primary_button_text_color: #FFFFFF;
--modal_primary_button_border_color: #000596;
--modal_secondary_button_background_color: #FFFFFF;
--modal_secondary_button_text_color: #000596;
--modal_secondary_button_border_color: #000596;

/* ===== shadcn/Tailwind Mappings ===== */

/* Backgrounds & Foregrounds */
--background: var(--page_background_color);
--foreground: var(--page_text_color);

/* Card (modals, dialogs, popovers) */
--card: var(--modal_background_color);
--card-foreground: var(--modal_text_color);
--popover: var(--modal_background_color);
--popover-foreground: var(--modal_text_color);

/* Primary (main actions) */
--primary: var(--primary_button_background_color);
--primary-foreground: var(--primary_button_text_color);

/* Secondary (alternate actions) */
--secondary: var(--secondary_button_background_color);
--secondary-foreground: var(--secondary_button_text_color);

/* Muted (subtle elements) */
--muted: var(--input_field_background_color);
--muted-foreground: var(--input_field_text_color);

/* Accent (highlights, hovers) */
--accent: var(--input_field_background_color);
--accent-foreground: var(--input_field_text_color);

/* Destructive (danger, delete) */
--destructive: #ef4444;
--destructive-foreground: #FFFFFF;

/* Form elements */
--border: var(--input_field_border_color);
--input: var(--input_field_background_color);
--ring: var(--primary_button_border_color);

/* Border Radius */
--radius: 0.5rem;
}

Variable Categories

Page Variables

Control the main page appearance:

VariableDescriptionUsed By
--backgroundMain page backgroundbg-background
--foregroundMain text colortext-foreground

Button Variables

Control button appearance:

VariableDescriptionUsed By
--primaryPrimary button backgroundbg-primary
--primary-foregroundPrimary button texttext-primary-foreground
--secondarySecondary button backgroundbg-secondary
--secondary-foregroundSecondary button texttext-secondary-foreground
--destructiveDestructive button backgroundbg-destructive
--destructive-foregroundDestructive button texttext-destructive-foreground

Form Variables

Control form element appearance:

VariableDescriptionUsed By
--inputInput backgroundbg-input
--borderInput/element bordersborder-border
--ringFocus ring colorring-ring

Card/Modal Variables

Control elevated surfaces:

VariableDescriptionUsed By
--cardCard backgroundbg-card
--card-foregroundCard texttext-card-foreground
--popoverPopover backgroundbg-popover
--popover-foregroundPopover texttext-popover-foreground

Accent Variables

Control highlights and subtle states:

VariableDescriptionUsed By
--mutedMuted backgroundbg-muted
--muted-foregroundMuted texttext-muted-foreground
--accentAccent/hover backgroundbg-accent
--accent-foregroundAccent texttext-accent-foreground

Layout Variables

Control spacing and sizing:

VariableDescriptionDefault
--radiusBorder radius base0.5rem

Tailwind Mappings

The Tailwind configuration maps CSS variables to utility classes:

// tailwind.config.ts
export default {
theme: {
extend: {
colors: {
background: 'var(--background)',
foreground: 'var(--foreground)',
card: {
DEFAULT: 'var(--card)',
foreground: 'var(--card-foreground)',
},
popover: {
DEFAULT: 'var(--popover)',
foreground: 'var(--popover-foreground)',
},
primary: {
DEFAULT: 'var(--primary)',
foreground: 'var(--primary-foreground)',
},
secondary: {
DEFAULT: 'var(--secondary)',
foreground: 'var(--secondary-foreground)',
},
muted: {
DEFAULT: 'var(--muted)',
foreground: 'var(--muted-foreground)',
},
accent: {
DEFAULT: 'var(--accent)',
foreground: 'var(--accent-foreground)',
},
destructive: {
DEFAULT: 'var(--destructive)',
foreground: 'var(--destructive-foreground)',
},
border: 'var(--border)',
input: 'var(--input)',
ring: 'var(--ring)',
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)',
},
},
},
}

Using Variables in Custom CSS

Direct Usage

.my-custom-element {
background-color: var(--background);
color: var(--foreground);
border: 1px solid var(--border);
border-radius: var(--radius);
}

.my-custom-element:focus {
outline: none;
box-shadow: 0 0 0 2px var(--ring);
}

With Fallbacks

.my-element {
/* Fallback if variable not defined */
background-color: var(--background, #ffffff);
}

Computed Values

.my-element {
/* Smaller radius */
border-radius: calc(var(--radius) / 2);

/* Transparent version */
background-color: color-mix(in srgb, var(--primary) 10%, transparent);
}

Platform Integration

When used within the GXP platform, these variables are automatically set by the platform's theming system:

// Platform injects these at runtime
document.documentElement.style.setProperty('--page_background_color', theme.backgroundColor)
document.documentElement.style.setProperty('--primary_button_background_color', theme.primaryColor)
// ... etc

The shadcn mappings (--background, --primary, etc.) reference the platform variables, so components automatically update when the platform theme changes.