You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure you're not using dynamic class names (half-variable like btn-{$color}). If you do this, there is no way for Tailwind CSS to find your class names.
Using Tailwind CSS and daisyUI, it is expected for CSS files to be very small. Ideally only the class names you used must be in the CSS file. Sometimes (specially in monorepos) it is possible that Tailwind CSS automatic class name detection finds some unwanted strings in your project and generate styles for them. To avoid this, you can disable automatic detection and register your source files using @source directive.
checkbox/toggle/radio styles are broken
Probably you're using @tailwindcss/forms (or another style or plugin) that is affecting form elements.
daisyUI applies styles to class names but @tailwindcss/forms by default, applies styles to all form elements.
If you really need @tailwindcss/forms alongside with daisyUI (which I doubt, because both are doing the same job) consider using its strategy: 'class' config so it only applies style to the elements with specific class name (not all form elements)
With daisyUI, you don't need to manually set colors using dark: variant
As long as you use daisyUI colors they will work on all themes, light or dark.
If you really want to use Tailwind's dark: variant, here's how to do it.
This page is locked to stay clean. If you have a questions, open a new discussion.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
class names are not working
btn-{$color}
). If you do this, there is no way for Tailwind CSS to find your class names.@source
Explicitly register sourcesCSS files is too big
Using Tailwind CSS and daisyUI, it is expected for CSS files to be very small. Ideally only the class names you used must be in the CSS file. Sometimes (specially in monorepos) it is possible that Tailwind CSS automatic class name detection finds some unwanted strings in your project and generate styles for them. To avoid this, you can disable automatic detection and register your source files using
@source
directive.checkbox/toggle/radio styles are broken
Probably you're using
@tailwindcss/forms
(or another style or plugin) that is affecting form elements.daisyUI applies styles to class names but
@tailwindcss/forms
by default, applies styles to all form elements.If you really need
@tailwindcss/forms
alongside with daisyUI (which I doubt, because both are doing the same job) consider using itsstrategy: 'class'
config so it only applies style to the elements with specific class name (not all form elements)themes are not working
data-theme
on your<html>
tag:Tailwind's
dark:
prefix is not workingWith daisyUI, you don't need to manually set colors using
dark:
variantAs long as you use daisyUI colors they will work on all themes, light or dark.
If you really want to use Tailwind's
dark:
variant, here's how to do it.This page is locked to stay clean. If you have a questions, open a new discussion.
Beta Was this translation helpful? Give feedback.
All reactions