-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tailwind should throw an error when trying to @apply group
#4553
Comments
Hey! Yeah you definitely do not want to apply I think the best move here is probably to build in an explicit error for this in Tailwind so the build fails. I'll move this to the Tailwind repo 👍🏻 |
@apply group
Hello! Yeah it makes total sense and was the reason I didn't flag as a bug. Thanks for sharing the link to the other issue. I will have a read 👍 Solution sounds good. |
I noticed that this also applies for |
I'm flagging a potential addition to documentation as my team have discovered our production builds are growing considerably when using
@apply group
.For example:
and then another similar
.button--secondary
also using@apply group
is resulting in a very large production file at ~1.8MB. All production settings such as PurgeCSS and minification were being respected so no problem there. Having removed@apply group
(and just adding it directly to the component in the HTML) means our builds are now coming out at ~166KB - so a massive improvement!So I am wondering if this is something worth flagging specifically in the documentation around the
group-hover
andgroup-focus
variants, that usage of@apply group
will inflate builds? The documentation does mention filesize considerations so this might already be deemed sufficient. Equally I might have just overlooked something. Any guidance appreciated - thanks.The text was updated successfully, but these errors were encountered: