Skip to content

bug: daisyui always emits variables to @layer base #3937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Freymaurer opened this issue Jun 3, 2025 · 2 comments
Closed

bug: daisyui always emits variables to @layer base #3937

Freymaurer opened this issue Jun 3, 2025 · 2 comments

Comments

@Freymaurer
Copy link

Reproduction URL (Required)

https://play.tailwindcss.com/z19vEIqURl?file=css

What version of daisyUI are you using?

v5.0.40

Which browsers are you seeing the problem on?

All browsers

Describe your issue

I am working on a component library using tailwind 4 and daisyui 5. This created issues with the produced css if it is referenced in a project using tailwind 3, with the following error: @layer base is used but no matching @tailwind base directive is present.

As the library is intented to work just from the css file without any tailwind requirements i looked for a workaorund and found the following solution: tailwindlabs/tailwindcss#18123 (reply in thread)

I renamed all layers but still had @layer base in the generated css. This was due to daisyui using the layer to add variables. The referenced tailwind play link reproduces this issue.

Maybe it is possible to add a config option for this case?

Thanks in advance, let me know if i can somehow help to speed up the fix for this, as it is currently a major blocker.

Copy link

github-actions bot commented Jun 3, 2025

Thank you @Freymaurer for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

@saadeghi
Copy link
Owner

saadeghi commented Jun 3, 2025

I understand.
Unfortunately, it's not possible yet to use another layer name due to Tailwind CSS plugin API.
Tailwind CSS provides APIs like addBase, addComponents, addUtilities
addBase always adds styles to Tailwind's predefined @layer base and addComponents, addUtilities always add styles to Tailwind's predefined @layer utilities.

If Tailwind provides more access regarding this behavior, we may be able to provide an option as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants