-
Currently there are 3 primary color names, namely "primary", "primary-focus" and "primary-content". Is there a way to extend it with more colors, like "primary-hover" for example? Thanks in advance :) |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 25 replies
-
The best way is to extend Tailwind CSS color using CSS variables https://play.tailwindcss.com/zuwkjrS6yl?file=config // tailwind.config.js
module.exports = {
plugins: [require('daisyui')],
theme: {
extend: {
colors: {
'primary-cool': "hsl(var(--primary-cool) / <alpha-value>)",
},
},
},
daisyui: {
themes: [
{
light: {
...require('daisyui/src/theming/themes')['[data-theme=light]'],
'--primary-cool': '338 83% 66%',
},
},
{
cupcake: {
...require('daisyui/src/theming/themes')['[data-theme=cupcake]'],
'--primary-cool': '38 83% 66%',
},
},
],
},
} Edit: updated example. |
Beta Was this translation helpful? Give feedback.
-
What do these color var names mean?? Thanks, |
Beta Was this translation helpful? Give feedback.
-
Is it possible to assign the variable in hex format like this: While still being able to set opacity? |
Beta Was this translation helpful? Give feedback.
-
Here's the official Blog article on this same. :) |
Beta Was this translation helpful? Give feedback.
-
While searching for a solution to cross this border, I came across the top answer, but it didn't work for me. Instead, here's what worked: Navigate to
Then you'd be able to easily customize theme color in my case
The primary color has been modified |
Beta Was this translation helpful? Give feedback.
The best way is to extend Tailwind CSS color using CSS variables
and then define that variable value in daisyUI themes:
https://play.tailwindcss.com/zuwkjrS6yl?file=config