v5 use existing theme as base #3538
-
Hi there! Is it possible in v5 to use an existing theme as a base? For example, I'd like to start with the light theme as a base and customize it with other colors and name it something else like I see in the docs you can customize an existing theme here, but that isn't quite what I need. In the previous version, you could do something like this: // tailwind config
const baseTheme = {
...require('daisyui/src/theming/themes')['light'],
primary: '#5c789e',
secondary: '#f7fafc',
accent: '#949494',
'primary-content': '#ffffff',
}
...
daisyui: {
themes: [
{
baseTheme,
MyLight: {
...baseTheme,
primary: '#722CCF',
},
},
], |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, Back then it was a JS object so you could do that. You could even do any other object manipulations with JS. However, good news is, you can just add multiple themes, with any color and any name. For example, go to https://v5.daisyui.com/theme-generator/ customize Let me know if you have a question. |
Beta Was this translation helpful? Give feedback.
Hey,
Back then it was a JS object so you could do that. You could even do any other object manipulations with JS.
Now it's a CSS file and those are not possible here.
daisyUI 5 still made it possible to extend built-in themes based on the name. So if you're extending
light
theme, name should stay light.However, good news is, you can just add multiple themes, with any color and any name. For example, go to https://v5.daisyui.com/theme-generator/ customize
light
theme, change its name and add it to your CSS.Let me know if you have a question.