Skip to main content
On this page

Colors

Visual reference for all 8 semantic colors, base surface scale, and border tokens available in every Ninna UI theme.

Interactive Theme Showcase

Choose a preset or switch modes to preview the website with Ninna's semantic theme colors.

Theme preview

Interactive Elements

Forms & Toggles

Dark mode

Push Notifications

Semantic Colors

primary
secondary
accent
success
warning
danger
info
neutral

Surfaces & Data

Light to dark cascading scales

75%

Semantic Colors

Eight color roles for actions, emphasis, and status. Pair each solid background with its matching content color.

Primary

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

bg-primarytext-primary

Secondary

Supporting brand color. Used for secondary actions and accents.

bg-secondarytext-secondary

Accent

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

bg-accenttext-accent

Neutral

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

bg-neutraltext-neutral

Success

Positive states - confirmations, completed actions, valid inputs.

bg-successtext-success

Danger

Error and destructive states - validation errors, delete confirmations.

bg-dangertext-danger

Warning

Caution states - non-blocking alerts, expiration notices.

bg-warningtext-warning

Info

Informational states - tips, help text, neutral notifications.

bg-infotext-info

Content colors are automatically set per theme. Use text-primary-content on bg-primary for guaranteed WCAG AA contrast.

Base Surface Scale

Ten neutral steps for backgrounds, surfaces, and borders. The scale adapts automatically 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

Border Tokens

Border tokens for default, hover, active, and disabled states.

border-borderDefault resting borders
border-border-hoverInteractive hover states
border-border-activeFocus and active states
border-border-disabledDisabled empty layout boundaries

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