Override single theme's colours in daisyUI 5 #4034
-
I am trying to override the --color-error for the lemonade theme, but I seems to not take effect. Link to example: Both attempts of configuration in the css didn't work. Unfortunately, How to add a new color to daisyUI themes Your help is much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
this is invalid @plugin "daisyui" {
themes: lemonade --default;
--color-error: green;
} You're not seeing the custom theme because your OS/browser is in dark mode, so you're seeing the Do this: @import 'tailwindcss';
@plugin "daisyui";
@plugin "daisyui/theme" {
name: "lemonade";
default: false;
prefersdark: false;
color-scheme: "light";
--color-base-100: oklch(98.71% 0.02 123.72);
--color-base-200: oklch(91.8% 0.018 123.72);
--color-base-300: oklch(84.89% 0.017 123.72);
--color-base-content: oklch(19.742% 0.004 123.72);
--color-primary: oklch(58.92% 0.199 134.6);
--color-primary-content: oklch(11.784% 0.039 134.6);
--color-secondary: oklch(77.75% 0.196 111.09);
--color-secondary-content: oklch(15.55% 0.039 111.09);
--color-accent: oklch(85.39% 0.201 100.73);
--color-accent-content: oklch(17.078% 0.04 100.73);
--color-neutral: oklch(30.98% 0.075 108.6);
--color-neutral-content: oklch(86.196% 0.015 108.6);
--color-info: oklch(86.19% 0.047 224.14);
--color-info-content: oklch(17.238% 0.009 224.14);
--color-success: oklch(86.19% 0.047 157.85);
--color-success-content: oklch(17.238% 0.009 157.85);
--color-warning: oklch(86.19% 0.047 102.15);
--color-warning-content: oklch(17.238% 0.009 102.15);
--color-error: green;
--color-error-content: oklch(17.238% 0.009 25.85);
--radius-selector: 1rem;
--radius-field: 0.5rem;
--radius-box: 1rem;
--size-selector: 0.25rem;
--size-field: 0.25rem;
--border: 1px;
--depth: 0;
--noise: 0;
} Or disable light and dark themes and set your theme as default: @import 'tailwindcss';
@plugin "daisyui" {
themes: false;
}
@plugin "daisyui/theme" {
name: "lemonade";
default: true;
prefersdark: false;
color-scheme: "light";
--color-base-100: oklch(98.71% 0.02 123.72);
--color-base-200: oklch(91.8% 0.018 123.72);
--color-base-300: oklch(84.89% 0.017 123.72);
--color-base-content: oklch(19.742% 0.004 123.72);
--color-primary: oklch(58.92% 0.199 134.6);
--color-primary-content: oklch(11.784% 0.039 134.6);
--color-secondary: oklch(77.75% 0.196 111.09);
--color-secondary-content: oklch(15.55% 0.039 111.09);
--color-accent: oklch(85.39% 0.201 100.73);
--color-accent-content: oklch(17.078% 0.04 100.73);
--color-neutral: oklch(30.98% 0.075 108.6);
--color-neutral-content: oklch(86.196% 0.015 108.6);
--color-info: oklch(86.19% 0.047 224.14);
--color-info-content: oklch(17.238% 0.009 224.14);
--color-success: oklch(86.19% 0.047 157.85);
--color-success-content: oklch(17.238% 0.009 157.85);
--color-warning: oklch(86.19% 0.047 102.15);
--color-warning-content: oklch(17.238% 0.009 102.15);
--color-error: green;
--color-error-content: oklch(17.238% 0.009 25.85);
--radius-selector: 1rem;
--radius-field: 0.5rem;
--radius-box: 1rem;
--size-selector: 0.25rem;
--size-field: 0.25rem;
--border: 1px;
--depth: 0;
--noise: 0;
} |
Beta Was this translation helpful? Give feedback.
this is invalid
You're not seeing the custom theme because your OS/browser is in dark mode, so you're seeing the
dark
theme, as expected.Do this:
Use
data-theme="lemonade"
so you will see the lemonade theme if it's not default:https://play.tailwindcss.com/62rm7v9y6Q