I am using PUG + Tailwind + PostCSS for a static, single page HTML file which is generated using basic NPM scripts (shown below)
I would like the final HTML to have the tailwind styles inlined directly in the index.html page, instead of being generated as a .css file which is them referenced in the index.html file.
Instead of using an external file:
link(rel="stylesheet" href="styles.css")
I want this:
<style>
// all my (tailwind) CSS here
</style>
Obviously the injection has to happen after Pug has compiled and also tailwind has been compiled.
My question is, is there a Tailwind plugin or is a PostCSS-cli plugin/setting?
I have been searching for a few hours without luck.
Here's my NPM scripts:
"start": "npm run build && npm run css",
"build": "pug -O src/data/index.js -P -w src/html/index.pug -o dist",
"css": "postcss -o ./dist/styles.css ./src/css/*.css --watch",