Colors
Visual reference for all 8 semantic colors, base surface scale, and border tokens available in every Ninna UI theme.
Semantic Colors
8 semantic colors available in every theme. Each color has a matching -content color for guaranteed text contrast.
Primary
--color-primaryMain brand color. Used for primary actions, links, and key UI elements.
bg-primarytext-primarytext-primary-contentSecondary
--color-secondarySupporting brand color. Used for secondary actions and accents.
bg-secondarytext-secondarytext-secondary-contentAccent
--color-accentHighlight color for special elements, tags, and decorative UI.
bg-accenttext-accenttext-accent-contentNeutral
--color-neutralMuted color for subtle backgrounds, disabled states, and secondary text.
bg-neutraltext-neutraltext-neutral-contentSuccess
--color-successPositive states — confirmations, completed actions, valid inputs.
bg-successtext-successtext-success-contentDanger
--color-dangerError and destructive states — validation errors, delete confirmations.
bg-dangertext-dangertext-danger-contentWarning
--color-warningCaution states — non-blocking alerts, expiration notices.
bg-warningtext-warningtext-warning-contentInfo
--color-infoInformational states — tips, help text, neutral notifications.
bg-infotext-infotext-info-contentContent colors are automatically set per theme. Use text-primary-content on bg-primary for guaranteed WCAG AA contrast.
Base Surface Scale
10-step neutral surface scale from lightest to darkest. Automatically inverts in dark mode.
base-50Lightest surface — page background
base-100Card / panel backgrounds
base-200Subtle backgrounds, code blocks
base-300Borders, dividers
base-400Disabled borders
base-500Placeholder text
base-600Secondary text
base-700Heading text
base-800Primary text
base-900Darkest surface
base-content
Default text color — adapts per theme and mode.
Border Tokens
4 border color tokens for consistent border styling across states.
border-borderDefault borders
border-border-hoverHover state borders
border-border-activeActive/focus borders
border-border-disabledDisabled state borders
Usage Patterns
Common patterns for using colors in your components.
Color usage examples
/* Semantic colors as Tailwind utilities */<Button color="primary">Primary Action</Button><Badge color="success">Active</Badge><Alert color="danger">Error occurred</Alert>
/* Background + content pairs (auto-contrast) */<div className="bg-primary text-primary-content"> White text on primary background</div>
/* Text colors for inline use */<Text className="text-base-content">Default text</Text><Text className="text-base-content/70">Secondary text (70% opacity)</Text><Text className="text-base-content/70">Muted text (40% opacity)</Text>
/* Base surface scale */<div className="bg-base-50">Page background</div><div className="bg-base-100">Card background</div><div className="bg-base-200">Subtle background</div><div className="border border-base-300">Border</div>Opacity modifiers: Use Tailwind opacity syntax liketext-base-content/70 for secondary text. This works with all semantic colors too:bg-primary/10 for subtle tinted backgrounds.
Custom Colors
Override any CSS variable to create your own theme or brand colors. All 31 variables are customizable.
Override primary color in your CSS
/* In your main CSS file — override after the theme import */@import "tailwindcss";@import "@ninna-ui/core/theme/presets/default.css";
/* Override primary to your brand color */[data-theme="default"] { --color-primary: oklch(0.52 0.28 220); /* brand blue */ --color-primary-content: oklch(0.98 0.005 220); /* white text on primary */
/* Override secondary */ --color-secondary: oklch(0.48 0.22 160); /* brand teal */ --color-secondary-content: oklch(0.98 0.005 160);
/* Override base surfaces for a warmer feel */ --color-base-50: oklch(0.985 0.005 80); --color-base-100: oklch(0.970 0.008 80); --color-base-200: oklch(0.940 0.010 80);}
/* Dark mode overrides — both selector forms required */.dark [data-theme="default"],[data-theme="default"].dark { --color-primary: oklch(0.72 0.22 220); --color-primary-content: oklch(0.12 0.02 220);}All overridable variables
--color-primaryMain brand color
--color-primary-contentText on primary bg
--color-secondarySupporting brand color
--color-secondary-contentText on secondary bg
--color-accentHighlight color
--color-accent-contentText on accent bg
--color-neutralMuted/neutral color
--color-neutral-contentText on neutral bg
--color-successPositive state color
--color-success-contentText on success bg
--color-dangerError/destructive color
--color-danger-contentText on danger bg
--color-warningCaution state color
--color-warning-contentText on warning bg
--color-infoInformational color
--color-info-contentText on info bg
--color-base-50Lightest surface
--color-base-100Card background
--color-base-200Subtle background
--color-base-300Borders, dividers
--color-base-contentDefault text color
--color-borderDefault border
--color-border-hoverHover border
--color-border-activeActive/focus border
Content colors: When you change a semantic color, also update its -content counterpart to maintain WCAG AA contrast (minimum 4.5:1 ratio for normal text).