Theme Customization
Learn how to create custom themes for the UI Kit.
Basic Customization
Override Variables
The simplest way to customize is to override CSS variables after importing the styles:
// main.ts
import '@gxp-dev/uikit/styles'
import './my-overrides.css'
/* my-overrides.css */
:root {
--primary: #0066cc;
--primary-foreground: #ffffff;
--radius: 0.25rem;
}
Start Fresh
For complete control, import only base styles:
// main.ts
import '@gxp-dev/uikit/styles/base'
import './my-theme.css'
Creating a Custom Theme
Minimal Theme
A minimal theme needs these core variables:
/* minimal-theme.css */
:root {
/* Page */
--background: #ffffff;
--foreground: #0f172a;
/* Primary */
--primary: #2563eb;
--primary-foreground: #ffffff;
/* Secondary */
--secondary: #f1f5f9;
--secondary-foreground: #0f172a;
/* Borders & Inputs */
--border: #e2e8f0;
--input: #ffffff;
--ring: #2563eb;
/* Radius */
--radius: 0.5rem;
}
Complete Theme
A complete theme with all variables:
/* complete-theme.css */
:root {
/* Page backgrounds */
--background: #ffffff;
--foreground: #0f172a;
/* Card/Modal surfaces */
--card: #ffffff;
--card-foreground: #0f172a;
--popover: #ffffff;
--popover-foreground: #0f172a;
/* Primary actions */
--primary: #2563eb;
--primary-foreground: #ffffff;
/* Secondary actions */
--secondary: #f1f5f9;
--secondary-foreground: #0f172a;
/* Muted/subtle elements */
--muted: #f1f5f9;
--muted-foreground: #64748b;
/* Accents/highlights */
--accent: #f1f5f9;
--accent-foreground: #0f172a;
/* Destructive/danger */
--destructive: #dc2626;
--destructive-foreground: #ffffff;
/* Form elements */
--border: #e2e8f0;
--input: #ffffff;
--ring: #2563eb;
/* Border radius */
--radius: 0.5rem;
}