Skip to content

v5: How to use @apply with daisy classes #3361

Answered by saadeghi
amir20 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for reaching out.
There are 2 challenges here:

  1. Color variable names are changed according to Tailwind CSS 4 variables: https://v5.daisyui.com/docs/v5-beta/#improved-color-variables
  2. @apply menu-active won't work anymore, as both daisyUI 5 and Tailwind CSS 4 use native CSS nesting. they are working as a modifier, not an individual class name that Tailwind can simply extract from a nested tree and extend it into another class name.

But I see the challenge here. Remapping the color names and extending a modifier class name to another one shouldn't be needed to do in the first place.
Right now you can do something like this https://play.tailwindcss.com/PUyU2Fr1OP?file=css to move on f…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@amir20
Comment options

@amir20
Comment options

Answer selected by amir20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants