Skip to content

Fix media queries with jit and postcss7 - #4078

Merged
bradlc merged 1 commit into
tailwindlabs:masterfrom
jscissr:fix-postcss7
Apr 23, 2021
Merged

Fix media queries with jit and postcss7#4078
bradlc merged 1 commit into
tailwindlabs:masterfrom
jscissr:fix-postcss7

Conversation

@jscissr

@jscissr jscissr commented Apr 15, 2021

Copy link
Copy Markdown
Contributor

When using @tailwindcss/postcss7-compat and jit, media queries are not generated.

The problem is that this chunk of code: https://github.com/postcss/postcss/blob/8.2.10/lib/node.js#L44-L48
is missing in postcss 7: https://github.com/postcss/postcss/blob/7.0.35/lib/node.es6#L37
Which means that the parent of the rule is not set correctly, which then causes this bug.

This fixes #4034.

@codecov-commenter

codecov-commenter commented Apr 20, 2021

Copy link
Copy Markdown

Codecov Report

Merging #4078 (d889791) into master (b442c91) will decrease coverage by 0.01%.
The diff coverage is 75.00%.

❗ Current head d889791 differs from pull request most recent head 7324128. Consider uploading reports for the commit 7324128 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4078      +/-   ##
==========================================
- Coverage   86.84%   86.83%   -0.02%     
==========================================
  Files         341      341              
  Lines        4835     4838       +3     
  Branches      919      920       +1     
==========================================
+ Hits         4199     4201       +2     
- Misses        561      562       +1     
  Partials       75       75              
Impacted Files Coverage Δ
jit/lib/generateRules.js 92.45% <75.00%> (-0.50%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b442c91...7324128. Read the comment docs.

@bradlc
bradlc merged commit ed684b0 into tailwindlabs:master Apr 23, 2021
@bradlc

bradlc commented Apr 23, 2021

Copy link
Copy Markdown
Contributor

Amazing, thank you! ❤️

@gilesbutler

Copy link
Copy Markdown

Awesome work, thanks guys 👍

@dave-calleja

Copy link
Copy Markdown

I still seem to have the same issue even after upgraded to 2.1.2. Using @tailwindcss/postcss7-compat. Am I missing something?

@kb1995

kb1995 commented May 8, 2021

Copy link
Copy Markdown

@dave-calleja I have the same issue. I'm using @tailwindcss/postcss7-compat and updated to latest version, but classes such as flex are not working for me

pinging @bradlc

@adamwathan

Copy link
Copy Markdown
Member

Hey! Please create a new issue and include a minimal reproduction, we don't actively monitor closed issues/PRs.

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.

JIT does not respect mobile-first order

7 participants