Skip to content
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

Note that @layer CSS at-rule will not be output. #1892

Closed
wants to merge 1 commit into from

Conversation

kerryj89
Copy link

Returning to Tailwind after some time of using the native @layer system, I lost an hour of work thinking that something with my PostCSS setup was stripping my @layer at-rules. I think the at-rule has matured to the point where people that haven't been using Tailwind for a while (or never had) might expect to see it output. I see v4 will output this, but v3 simply reorders the rules for maximum compatibility.

I have read the documentation here multiple times and I feel if this statement was here it would click in my head sooner that Tailwind v3 does not actually output the @layer at-rules and instead tracks and reorders them. It was only when I started testing the outputs in the playground did I realize this distinction.

Feel free to reword and thanks for the otherwise great docs and css framework!

Returning to Tailwind after using native `@layer` system, I lost an hour of work thinking that something with my PostCSS setup was stripping my `@layer` at-rules.  I think the at-rule has matured to the point where people that haven't been using Tailwind for a while might expect to see it output.  I see v4 will output this, but v3 simply reorders the rules for maximum compatibility.

I have read the documentation here multiple times and I feel if this statement was here it would click in my head sooner that  Tailwind v3 does not actually output the `@layer` at-rules and instead tracks and reorders them.
Copy link

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tailwindcss-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 22, 2024 8:14pm

@kerryj89
Copy link
Author

If anyone stumbles on this, here's a helpful article that talks about what goes on under the hood on how Tailwind handles @layer https://emamoah.medium.com/using-native-css-cascade-layers-with-tailwindcss-cb11af266104

@philipp-spiess philipp-spiess changed the base branch from master to v3 January 28, 2025 17:04
@philipp-spiess
Copy link
Member

Hey! Thanks for the PR but we've since moved to the v4 docs which does not face the same issue anymore so going to close this one. Sorry for the long wait for a response here, we've all been pretty busy working on the v4 release stuff and these PRs unfortunately incurred a much longer than expected wait time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants