Need Assistance?

support@tutorialshub.in

Customization and Design Systems

Using @apply responsibly

ADVERTISEMENT
Tailwind CSS Free Lesson
5 min read
ADVERTISEMENT

What @apply does

The @apply directive lets you inline existing utility styles into a custom CSS rule. It can be useful for third-party markup that you cannot conveniently change or for a small CSS abstraction.

Do not rebuild Tailwind v3-style component classes everywhere

If every button becomes a CSS class containing a long @apply list, you lose much of the visibility and flexibility of utility-first composition. Prefer framework components when the pattern is application-specific.

Third-party integration

One strong use case is styling markup generated by a library where you do not control the class attributes.

ADVERTISEMENT