saadeghi/daisyui

bug: prefix doesnt work on color utilities

Hasban-Fardani opened this issue · 2 comments

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

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.

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.