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
Here's the solution that worked for me:
I used the PostCSS method as mentioned in the Tailwind CSS documentation and then added comments at the top of the main.css (which is the CSS folder) file. So when I compile (using
npm run dev
) the CSS the comments get copied to the output file. The package.json "scripts" tag is as follows:
"scripts": { "dev": "postcss css/main.css -o style.css" }