Design Tokens
ggui uses the DTCG (Design Tokens Community Group) specification for its theming system. All primitives consume tokens via CSS custom properties with hardcoded fallbacks.
/* Example usage in a component */color: var(--ggui-color-primary-600, #0284c7);padding: var(--ggui-spacing-md, 16px);border-radius: var(--ggui-radius-md, 8px);Colors
Section titled “Colors”Color Palettes
Section titled “Color Palettes”Primary (Sky Blue)
50
100
200
300
400
500
600
700
800
900
Gray
50
100
200
300
400
500
600
700
800
900
Success
50
100
200
500
600
700
800
Warning
50
100
200
500
600
700
800
Error
50
100
200
500
600
700
800
Info
50
100
200
500
600
700
800
Semantic Colors
Section titled “Semantic Colors”These tokens map to specific UI roles and adapt between light and dark themes.
Spacing
Section titled “Spacing”A consistent spacing scale ensures visual rhythm across all components.
xs 4px --ggui-spacing-1 sm 8px --ggui-spacing-2 md 16px --ggui-spacing-4 lg 24px --ggui-spacing-6 xl 32px --ggui-spacing-8 2xl 48px --ggui-spacing-12 3xl 64px --ggui-spacing-3xl Typography
Section titled “Typography”Font Families
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
Font Sizes
xs 12px --ggui-font-size-xs sm 14px --ggui-font-size-sm base 16px --ggui-font-size-base lg 18px --ggui-font-size-lg xl 20px --ggui-font-size-xl 2xl 24px --ggui-font-size-2xl 3xl 30px --ggui-font-size-3xl 4xl 36px --ggui-font-size-4xl Font Weights
Normal
The quick brown fox jumps over the lazy dog
400 Medium
The quick brown fox jumps over the lazy dog
500 Semibold
The quick brown fox jumps over the lazy dog
600 Bold
The quick brown fox jumps over the lazy dog
700 Line Heights
Tight
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
1.25 Normal
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
1.5 Relaxed
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
1.75 Border Radius
Section titled “Border Radius”--ggui-shape-radius-none--ggui-shape-radius-sm--ggui-shape-radius-md--ggui-shape-radius-lg--ggui-shape-radius-xl--ggui-shape-radius-2xl--ggui-shape-radius-fullShadows
Section titled “Shadows”Using Tokens
Section titled “Using Tokens”In React Components
Section titled “In React Components”All @ggui-ai/design primitives use CSS variables with fallbacks:
import { Button, Card, Input } from '@ggui-ai/design';
// Primitives automatically use design tokens<Card> <Input placeholder="Enter your name" /> <Button variant="primary">Submit</Button></Card>Custom Components
Section titled “Custom Components”Reference tokens directly in your CSS:
.my-component { background: var(--ggui-color-surface, #ffffff); padding: var(--ggui-spacing-md, 16px); border-radius: var(--ggui-radius-lg, 12px); box-shadow: var(--ggui-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1)); font-family: var(--ggui-font-family-sans, Inter, system-ui, sans-serif); font-size: var(--ggui-font-size-sm, 14px); color: var(--ggui-color-text-primary, #111827);}Theming
Section titled “Theming”Override tokens at the root level to apply a custom theme:
:root { --ggui-color-primary-600: #7c3aed; /* Purple instead of sky blue */ --ggui-color-background: #fefce8; /* Warm background */ --ggui-radius-md: 16px; /* More rounded corners */}See the Custom Theming cookbook for a complete guide.