Skip to main content

Theming Quick Start

Quick reference for working with daisyUI themes in Noderium.


Quick Start

Switching Themes

// Change theme in HTML
document.documentElement.setAttribute('data-theme', 'dark')

// Save to localStorage
localStorage.setItem('theme', 'dark')

Using Theme Components

import { ThemeSelector } from './components/ThemeSelector'

<ThemeSelector /> // Complete theme selector
// or
<ThemeToggle /> // Simple light/dark toggle

Available Themes

Currently enabled in the project (see App.css):

  • light — Default theme
  • dark — Dark theme

To enable more themes, edit App.css:

@import "tailwindcss";
@plugin "daisyui" {
themes: light --default, dark, cupcake, synthwave, dracula;
}
tip

Use --default after a theme name to set it as the default. If no themes config is provided, all built-in themes are available.

All DaisyUI Built-in Themes

Light Themes

ThemeDescription
lightDefault light theme
cupcakeSoft pastel colors
bumblebeeYellow/amber accent
emeraldGreen accent
corporateProfessional blue tones
retroVintage/retro palette
valentinePink/romantic tones
gardenNatural greens
aquaCyan/aqua tones
lofiMinimal, low-contrast
pastelSoft pastel palette
fantasyPurple/magical tones
wireframeMinimal, monochrome
cmykPrint-inspired colors
autumnWarm fall tones
acidNeon/vibrant colors
lemonadeYellow/green fresh tones
winterCool blue tones
caramellatteWarm caramel tones
silkElegant, soft palette

Dark Themes

ThemeDescription
darkDefault dark theme
synthwaveNeon 80s aesthetic
cyberpunkCyberpunk neon style
halloweenOrange/purple dark
forestDark greens
blackPure black background
luxuryGold accents on dark
draculaDracula color scheme
nightDeep blue dark
coffeeWarm brown dark
businessProfessional dark
dimSubtle dark palette
nordNord color scheme
sunsetWarm sunset tones
abyssDeep dark blue

Creating a New Theme

In the App.css file:

[data-theme="mytheme"] {
color-scheme: light; /* or 'dark' */

/* Main colors */
--color-primary: oklch(55% 0.32 240);
--color-secondary: oklch(70% 0.25 200);
--color-accent: oklch(65% 0.25 160);

/* Backgrounds */
--color-base-100: oklch(98% 0.02 240);
--color-base-200: oklch(95% 0.03 240);
--color-base-300: oklch(92% 0.04 240);
--color-base-content: oklch(20% 0.05 240);

/* States */
--color-info: oklch(70% 0.22 220);
--color-success: oklch(65% 0.25 140);
--color-warning: oklch(80% 0.20 80);
--color-error: oklch(65% 0.33 0);

/* Others */
--radius-box: 1rem;
}

OKLCH Format:

oklch(lightness% chroma hue)
  • lightness: 0-100% (black → white)
  • chroma: 0-0.4 (gray → saturated)
  • hue: 0-360 (red → green → blue → red)

Editing Existing Themes

/* Override only what you want to change */
[data-theme="light"] {
--color-primary: oklch(65% 0.28 180); /* Cyan primary */
--radius-box: 0.25rem; /* More squared corners */
/* Other variables inherit from the original theme */
}

Most Used Variables

Colors

VariableUsage
--color-primaryApp's primary color
--color-base-100Main background
--color-base-200Card background
--color-base-contentText color
--color-infoInformative messages
--color-successPositive feedback
--color-errorErrors and alerts

CSS Classes (Tailwind CSS)

<div class="bg-base-100 text-base-content">
<button class="btn btn-primary">Primary</button>
<button class="btn btn-secondary">Secondary</button>
<div class="card bg-base-200">Card</div>
<div class="alert alert-success">Success!</div>
</div>

Tools


Best Practices

Do:

  • Use daisyUI classes instead of hardcoded colors
  • Test in both light and dark themes
  • Save user preference to localStorage
  • Respect system prefers-color-scheme

Don't:

  • Use RGB/HSL in variables (use OKLCH)
  • Ignore contrast ratios (always define -content variants)
  • Create too many custom colors

Next Steps

For a complete guide with detailed examples and best practices, see Theming Complete Guide.