saadeghi / daisyui

🌼 🌼 🌼 🌼 🌼  The most popular, free and open-source Tailwind CSS component library
https://daisyui.com
MIT License
34.13k stars 1.3k forks source link

fix: tailwindcss neutral color compatibility #3241

Closed Innei closed 2 weeks ago

Innei commented 1 month ago

like neutral-50 will be compatible with postcss @apply text-neutral-50/0.5

saadeghi commented 1 month ago

It already works: https://play.tailwindcss.com/sJeDF0hk7x?file=css

What's the issue?

Innei commented 1 month ago

@saadeghi The text-neutral-50/0.5 class does not exist. If text-neutral-50/0.5 is a custom class, make sure it is defined within a @layer directive.

CleanShot 2024-10-20 at 12  49 30@2x

saadeghi commented 1 month ago

opacity is 0 to 100 (not 0.5)
https://tailwindcss.com/docs/text-color#changing-the-opacity

Innei commented 1 month ago

@saadeghi theme(colors.neutral.400/0.3) postcss theme() is 0-1 not 0-100

Innei commented 3 weeks ago

@saadeghi This is not compatible, please reopen this pr

saadeghi commented 3 weeks ago

I can't merge this PR.
It's importing Tailwind CSS but Tailwind CSS is not a dependency of daisyUI.
Apart from that, I'm not sure what issue it's going to solve. theme() is a directive from Tailwind CSS and it accepts opacity values from 0 to 100. 0.5 is not valid.

If you're having an issue in a specific setup, please share a minimal reproduction link.

Innei commented 3 weeks ago

But theme(colors.neutral.50/10);

also got error

saadeghi commented 3 weeks ago

@Innei Can you tell me how you're using it? A minimal reproduction link?

Innei commented 3 weeks ago

Thx reply. Demo is:

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

https://github.com/saadeghi/daisyui/issues/3250

Innei commented 3 weeks ago

I've changed it, please review again

saadeghi commented 2 weeks ago

The build is failing and colors.neutral is broken now.