-
So I am really enjoying DaisyUI and love the semantic way of naming colours so there is only one colour name for both dark and light modes. Really speeds up the dev process. I've been starting to tweak themes and add my own custom colours but I am getting a little unsure of what exactly the For example in this instance I expect the block bg to be neutral, and the block text to be neutral-content: <div class="mr-5 h-40 w-40 bg-neutral flex-center">
<p class="">Test</p>
</div> Yet even though the colour of the bg changes, the text content doesnt. The only way I can set the text to the be neutral-content is to actually specifiy it:
So a few questions:
light: {
primary: '#a991f7',
secondary: '#f6d860',
accent: '#37cdbe',
neutral: '#919191',
'base-100': '#fefefe',
} Are all the content colours generated automatically based on the colours above? Or do the defaults remain and I need to put them if I want something other than the defaults? Thanks in advance.... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Only for daisyUI components. For example when you use
Yes. Because when you use the Tailwind CSS utility class So yes, every time you use
You can add a custom class name for your project like .color-primary {
@apply bg-primary text-primary-content; But I would suggest simply use both class names
For a custom theme it will automatically generate a foreground color with a good contrast for each of these colors. For example if the primary color is a light color and you don't specify a content color for it, it will generate a dark content color and if primary is a dark color it will generate a light content color for it. You can play with colors here and see the results: Press button to see all optionall colors. Let me know if you have any questions. |
Beta Was this translation helpful? Give feedback.
Only for daisyUI components. For example when you use
btn-primary
the background color will be primary and the text color will beprimary-content