'How can I keep/retain CSS comments in the Tailwind CSS build output?
I'm writing a theme for WordPress, which requires comments in the CSS file as follows:
/*
Theme Name: XX
Theme URI: http://wordpress.org/themes/xxtheme
Author: X team
Author URI: http://xx.org/
Description: X theme.
Version: 1.1
Text Domain: Xdomain
*/
Whenever I compile Tailwind CSS, the whole contents of style.css gets replaced. Is there an easy way to a retain part of the CSS file? I'm using the following command to build:
npx tailwindcss -i css/tailwind.css -o style.css
Solution 1:[1]
You could try safelisting the comments using https://purgecss.com/safelisting.html.
I presume you are using purgecss as part of the build, but you haven’t pasted the Tailwind CSS or Webpack configuration.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Peter Mortensen |
