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

@apply breaks @media queries #6986

Closed
GuillaumeAmat opened this issue Jan 9, 2022 · 2 comments
Closed

@apply breaks @media queries #6986

GuillaumeAmat opened this issue Jan 9, 2022 · 2 comments

Comments

@GuillaumeAmat
Copy link

GuillaumeAmat commented Jan 9, 2022

What version of Tailwind CSS are you using?

3.0.12 (latest as of today)

Reproduction URL

https://play.tailwindcss.com/Hs3b6gCqaN?file=css

Describe your issue

With Tailwind 3.0.12, @apply keywords break the media queries declared in the @layer base bloc.

For the record, I didn't test any other scenario. And it works as expected with Tailwind 3.0.11.

In the reproduction playground above, you can see that:

  • ❌ The text is red, even though it's defined inside a @media print bloc
  • ❌ The text is also 2rem, even though it's defined inside a @media print bloc AND not declared using @apply
  • ✅ If you comment/remove the line 16 @apply, the font-size is not overridden anymore
@thecrypticace
Copy link
Contributor

thecrypticace commented Jan 10, 2022

This got fixed as a side effect of merging #6999. We'll aim to cut a release tomorrow morning/afternoon.

And thank you for the report & providing a reproduction. I've added this as a test case to ensure it doesn't break in the future.

@GuillaumeAmat
Copy link
Author

My pleasure @thecrypticace, and thanks for the fix.

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

No branches or pull requests

2 participants