Skip to content

"Doubled" CSS output when purge includes "./**/*.md" #4714

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

Closed
vladdu opened this issue Jun 19, 2021 · 4 comments
Closed

"Doubled" CSS output when purge includes "./**/*.md" #4714

vladdu opened this issue Jun 19, 2021 · 4 comments

Comments

@vladdu
Copy link

vladdu commented Jun 19, 2021

What version of Tailwind CSS are you using?

2.2.2

What build tool (or framework if it abstracts the build tool) are you using?

tailwind-cli 2.2.2

What version of Node.js are you using?

14.17.0

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction repository

https://github.com/vladdu/tw_bug_doubled_css

Describe your issue

If the purge list includes "./**/*.{html,md}", it will pick all HTML and markdown files from node_modules. This keeps some unexpected classes from being purged, which is not a big deal, but the JIT compiler will "double" the CSS from the @tailwind pragmas, like the excerpt below. Note the additional lines with !important. I don't know if that is a real problem, but it was confusing to me.

The generated file in the reproduction repo is in out/main_jit.css

/*! tailwindcss v2.2.2 | MIT License | https://tailwindcss.com */

/*! tailwindcss v2.2.2 | MIT License | https://tailwindcss.com */

/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

/*
Document
========
*/

/*
Document
========
*/

/**
Use a better box model (opinionated).
*/

/**
Use a better box model (opinionated).
*/

*,
::before,
::after {
  box-sizing: border-box;
  box-sizing: border-box !important;
}
@tleish
Copy link

tleish commented Jun 20, 2021

May be related to #4701

@jskorlol
Copy link

#4721

I'm having the same problem.

@bradlc
Copy link
Contributor

bradlc commented Jun 21, 2021

Hey @vladdu. Thanks for reporting this. I looked into your reproduction and it turns out that it's actually related to !* being found in one of the .md files. I hope you don't mind but I am going to close this issue in favour of a new one with a more specific and minimal reproduction. Thanks again!

@bradlc bradlc closed this as completed Jun 21, 2021
@vladdu
Copy link
Author

vladdu commented Jun 21, 2021

Sure, no problem! Thanks!

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

4 participants