daisyUI 5 colors
daisyUI color names
primary: The main brand color.primary-content: Foreground content color for use onprimary.secondary: An optional secondary brand color.secondary-content: Foreground content color for use onsecondary.accent: An optional accent brand color.accent-content: Foreground content color for use onaccent.neutral: A dark neutral color for UI areas that do not use saturated colors.neutral-content: Foreground content color for use onneutral.base-100: The page base-surface color for blank backgrounds.base-200: A darker base shade that gives elevation.base-300: A still darker base shade that gives more elevation.base-content: Foreground content color for use on a base color.info: Color for information and help messages.info-content: Foreground content color for use oninfo.success: Color for success and safe-state messages.success-content: Foreground content color for use onsuccess.warning: Color for warning and caution messages.warning-content: Foreground content color for use onwarning.error: Color for error, danger, and destructive-action messages.error-content: Foreground content color for use onerror.
daisyUI color rules
- daisyUI adds semantic color names to the Tailwind CSS colors.
- Use daisyUI color names in utility classes as you use other Tailwind CSS color names. For example,
bg-primaryuses the primary color for the background. - The value of each daisyUI color name is a variable. Thus, the color can change with the theme.
- Do not use
dark:with daisyUI color names. - If possible, use only daisyUI color names. This lets colors change automatically with the theme.
- If you use a Tailwind CSS color name such as
red-500, its color stays the same in all themes. - If you use a daisyUI color name such as
primary, its color changes with the theme. - Avoid Tailwind CSS color names for text. For example,
text-gray-800onbg-base-100becomes unreadable in a dark theme becausebg-base-100is dark. *-contentcolors must have clear contrast with their related colors.- Use
base-*colors for most of the page. Use the default variant for all elements. Useprimaryonly for the most important element on the page. Use it only once. - In rare cases, you can use a Tailwind CSS color if content must keep the same color in all themes. For example, you can use
text-red-500instead oftext-error. For an SVG icon or chart, a fixed color can be necessary.
Enable and apply themes
The default configuration enables light and dark. In the daisyUI plugin, select specified themes, all themes, or no built-in themes:
- Use
themes: all;to enable all built-in themes. - Use
themes: false;to disable all built-in themes. Usually, do this before you define only custom themes. - Add
data-theme="THEME_NAME"to<html>or a nested element. You can nest themes with no depth limit.
daisyUI custom theme with custom colors
A CSS file that contains Tailwind CSS, daisyUI, and a custom daisyUI theme has this structure:
Rules
- You must include all CSS variables in the example.
- Colors can use OKLCH, hex, or another format.
- If you generate a custom theme, do not include the comments from the example. Give only the code.
Optional: Use the visual tool at https://daisyui.com/theme-generator/ to make a custom theme.
Change a built-in theme
Use the built-in theme name. Change only the necessary values. daisyUI inherits the other values:
For a custom CDN theme, define the same variables in a selector. The selector must match the selected data-theme and theme controller:
To make the Tailwind dark: variant follow one or more daisyUI themes, define a custom variant:


