Facebook Pixel

Is @apply bad in Tailwind?

Not inherently, but overusing it recreates the named-class problem Tailwind was meant to solve. Use it sparingly, mainly for shared component primitives, not as a default way to write styles.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in Common Tailwind CSS Mistakes That Bloat Your React Markup

Usually because you forgot to configure the content paths in the Tailwind config. Tailwind only generates CSS for classes it finds in the files you list, so if the paths are wrong or missing, no CSS is produced and your styles do not appear.

Extract a component so the long class string lives in one place, or use the @apply directive in CSS to combine utilities into a named class. Both keep markup readable, but use @apply sparingly.

Because the CDN ships the entire framework, including classes you do not use, which defeats one of Tailwind's main benefits. Install Tailwind properly so it scans your markup and ships only the classes you use.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.