Skip to content
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

bug: prefix doesnt work on color utilities #2917

Closed
Hasban-Fardani opened this issue Mar 18, 2024 · 2 comments
Closed

bug: prefix doesnt work on color utilities #2917

Hasban-Fardani opened this issue Mar 18, 2024 · 2 comments

Comments

@Hasban-Fardani
Copy link

What version of daisyUI are you using?

4.7.3

Which browsers are you seeing the problem on?

All browsers

Reproduction URL

https://play.tailwindcss.com/xcBGRwHHhx

Describe your issue

The color utilities not using prefix if i setting prefix on tailwind.config.js

Copy link

Thank you @Hasban-Fardani 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

It's intentional and it's because of the way Tailwind CSS color utility classes work.
For component class names, daisyUI as a plugin can register a new class name to Tailwind CSS and before that we are able to add a prefix to that class name (like btn)
For color names, we can't register a class name like bg-primary to Tailwind CSS. Instead we can only register a color name primary to Tailwind and Tailwind generates all the utility calsses for it so we can't add a prefix to the. Those class names are considered as Tailwind CSS class names while something like btn is considered a daisyUI class name.

FYI: You can add a prefix to all Tailwind CSS class names as well.

Let me know if you have a question.

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