Describe the bug
After upgrading from Tailwind CSS v3 to v4, all @apply directives inside .less files are broken. The build fails and styles are not applied.
Environment
- Tailwind CSS: v4.x
- Previous version: v3.x
- Preprocessor: Less
To Reproduce
- Have a project using Tailwind CSS v3 with
.less files containing @apply
- Upgrade to Tailwind CSS v4
- Run the build
- Observe errors related to
@apply not being recognized in .less files
Expected behavior
@apply should work in .less files as it did in v3, or a clear migration path should be provided.
Current behavior
Build fails with errors. @apply directives inside .less files are not processed by Tailwind v4.
Additional context
I have a large codebase with many .less files heavily using @apply. Migrating all of them is a significant effort.
Question
What is the recommended migration path for projects using @apply inside .less files?
Is there any workaround or compatibility layer planned for v4?
I understand that v4 is designed as a standalone CSS build tool and is not intended to be used alongside preprocessors like Less or Sass. However, a migration guide or an automated upgrade tool that handles .less files would be greatly appreciated.
Describe the bug
After upgrading from Tailwind CSS v3 to v4, all
@applydirectives inside.lessfiles are broken. The build fails and styles are not applied.Environment
To Reproduce
.lessfiles containing@apply@applynot being recognized in.lessfilesExpected behavior
@applyshould work in.lessfiles as it did in v3, or a clear migration path should be provided.Current behavior
Build fails with errors.
@applydirectives inside.lessfiles are not processed by Tailwind v4.Additional context
I have a large codebase with many
.lessfiles heavily using@apply. Migrating all of them is a significant effort.Question
What is the recommended migration path for projects using
@applyinside.lessfiles?Is there any workaround or compatibility layer planned for v4?
I understand that v4 is designed as a standalone CSS build tool and is not intended to be used alongside preprocessors like Less or Sass. However, a migration guide or an automated upgrade tool that handles
.lessfiles would be greatly appreciated.