Write a daisyui/theme block, set each color with its -content text color; hex works

How to make a daisyUI theme from a palette

A daisyUI 5 theme is a @plugin "daisyui/theme" block in your CSS file that names the theme and sets its color variables, --color-primary, --color-secondary, --color-accent and 17 more, most with a -content color for the text on it. To pick the colors on your real pages first, load your deployed site into Recolor (recolor.page) using the Recolor app, press Space until a palette fits, and read each swatch's contrast.

Last updated

daisyUI's 20 color names as its colors docs list them (daisyUI 5.8.0), read 14 Nov 2026, with a pick from Recolor's default palette and the contrast Recolor computes for each pair
Color namesWhat the docs say they are forA pick from the default palette
--color-primary and --color-primary-contentThe main color of your brand, and the text on it#264653 with white text, 10.08:1
--color-secondary and --color-secondary-contentThe optional, secondary color of your brand#2a9d8f with black text, 6.32:1
--color-accent and --color-accent-contentThe optional, accent color of your brand#e9c46a with #264653 text, 6.03:1
--color-neutral and --color-neutral-contentA dark color for the parts of the UI that are not saturatedLeft to the theme
--color-base-100, -200, -300 and --color-base-contentThe page's surface, two darker shades for elevation, and the page's textLeft to the theme
--color-info, -success, -warning and -error, each with -contentInformative, success, warning and error messages#f4a261 as warning and #e76f51 as error, each with dark text

The 20 color names

daisyUI's colors docs list 20 names: primary, secondary and accent for the brand, neutral for unsaturated parts, base-100 to base-300 for surfaces with base-content for text, and info, success, warning and error for messages. Each has a -content partner for the text on it; the three base shades share base-content.

Components set them for you. daisyUI's colors docs say btn-primary takes primary for background and border and primary-content for text, so choose each -content color with its color.

Writing the theme block

The themes docs (daisyUI 5.8.0) give two ways. To change a built-in theme, use its name: daisyUI's themes docs say every value you leave out is inherited from the original theme. With the default palette that reads:

CSS
/* app.css */
@import "tailwindcss";
@plugin "daisyui";
@plugin "daisyui/theme" {
  name: "light";
  default: true;
  --color-primary: #264653;
  --color-primary-content: #ffffff;
  --color-secondary: #2a9d8f;
  --color-secondary-content: #000000;
  --color-accent: #e9c46a;
  --color-accent-content: #264653;
  --color-warning: #f4a261;
  --color-warning-content: #264653;
  --color-error: #e76f51;
  --color-error-content: #000000;
}

A theme of your own takes a new name with default, prefersdark and color-scheme, and the docs' example sets all 20 colors:

CSS
@plugin "daisyui/theme" {
  name: "mytheme";
  default: true;
  prefersdark: false;
  color-scheme: light;
  --color-primary: #264653;
  --color-primary-content: #ffffff;
  /* and the other 18 color names */
}

daisyUI's themes docs write oklch, but their light-theme example sets --color-primary: blue;, so hex works too. Turn themes on in @plugin "daisyui" with themes: light --default, dark --prefersdark;. daisyUI's theme generator edits colors and previews them on daisyUI's components, which Recolor does not do: Recolor shows the palette on your own pages.

Try the palette on your deployed site first

Paste the deployed address into Recolor and press Space; lock a color you keep with L. Recolor reads daisyUI's colors as CSS variables, oklch included, following how it works.

Each swatch shows its contrast with black and white text, marked at 4.5:1: white on #264653 reads 10.08:1; #2a9d8f reads 3.32:1 with white and 6.32:1 with black, and #e76f51 3.09:1 and 6.79:1, so both take black -content text; #264653 reads 6.03:1 on #e9c46a and 4.89:1 on #f4a261, which you can check in a contrast matrix.

A localhost address is refused: deploy a preview or upload the saved page, as described in loading a page. Images, video and canvas keep their colors.

What Recolor's export gives you

The Tailwind v4 export writes --color-1 to --color-5, then --color-primary, --color-secondary and --color-accent as hex codes, the same three names daisyUI uses, among the export formats. Paste those three lines into the theme block as they are, without the @theme { wrapper or the numbered lines.

Every -content color, neutral, the base colors and the status colors are yours to set by hand.

Common questions

Do daisyUI theme colors have to be oklch?

No. The docs' own example sets --color-primary: blue;, so hex works too.

Do I have to set all 20 colors to change a built-in theme?

No. A block with a built-in theme's name inherits every value you leave out.

Does Recolor's Tailwind export paste into a daisyUI theme?

Yes. Its primary, secondary and accent lines carry daisyUI's names; set the -content colors by hand.

Can a daisyUI theme apply to one section of a page?

Yes. Add data-theme to any element and everything inside it takes that theme.

Is it free?

Yes. Loading a site, generating palettes and every export format are free, without an account, as shown on pricing.

Sources