Skip to main content
ninna-ui

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.

Aa

Primary

--color-primary

Main brand color. Used for primary actions, links, and key UI elements.

bg-primarytext-primarytext-primary-content
Aa

Secondary

--color-secondary

Supporting brand color. Used for secondary actions and accents.

bg-secondarytext-secondarytext-secondary-content
Aa

Accent

--color-accent

Highlight color for special elements, tags, and decorative UI.

bg-accenttext-accenttext-accent-content
Aa

Neutral

--color-neutral

Muted color for subtle backgrounds, disabled states, and secondary text.

bg-neutraltext-neutraltext-neutral-content
Aa

Success

--color-success

Positive states — confirmations, completed actions, valid inputs.

bg-successtext-successtext-success-content
Aa

Danger

--color-danger

Error and destructive states — validation errors, delete confirmations.

bg-dangertext-dangertext-danger-content
Aa

Warning

--color-warning

Caution states — non-blocking alerts, expiration notices.

bg-warningtext-warningtext-warning-content
Aa

Info

--color-info

Informational states — tips, help text, neutral notifications.

bg-infotext-infotext-info-content

Content 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-50

Lightest surface — page background

base-100

Card / panel backgrounds

base-200

Subtle backgrounds, code blocks

base-300

Borders, dividers

base-400

Disabled borders

base-500

Placeholder text

base-600

Secondary text

base-700

Heading text

base-800

Primary text

base-900

Darkest surface

base-content

Default text color — adapts per theme and mode.

AaAaAa

Border Tokens

4 border color tokens for consistent border styling across states.

border-border

Default borders

border-border-hover

Hover state borders

border-border-active

Active/focus borders

border-border-disabled

Disabled 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-primary

Main brand color

--color-primary-content

Text on primary bg

--color-secondary

Supporting brand color

--color-secondary-content

Text on secondary bg

--color-accent

Highlight color

--color-accent-content

Text on accent bg

--color-neutral

Muted/neutral color

--color-neutral-content

Text on neutral bg

--color-success

Positive state color

--color-success-content

Text on success bg

--color-danger

Error/destructive color

--color-danger-content

Text on danger bg

--color-warning

Caution state color

--color-warning-content

Text on warning bg

--color-info

Informational color

--color-info-content

Text on info bg

--color-base-50

Lightest surface

--color-base-100

Card background

--color-base-200

Subtle background

--color-base-300

Borders, dividers

--color-base-content

Default text color

--color-border

Default border

--color-border-hover

Hover border

--color-border-active

Active/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).