To use the Tailwind CLI and JIT engine locally in Paperstack, follow these steps:
- Install the Tailwind CLI tool.
- Create a
style.css file in the assets directory with the standard Tailwind directives. - Configure
tailwind.config.js to watch the output directory for HTML content. - Add build and watch scripts to
package.json to compile CSS from assets/style.css to output/style.css. - Run
npm run styles:watch alongside npm run dev during development, and npm run styles:build during the production build.
// tailwind.config.js
module.exports = {
content: [
"./output/**/*.html",
],
}
/* assets/style.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
{
"scripts": {
"build": "./node_modules/.bin/paper build",
"dev": "./node_modules/.bin/paper dev",
"styles:watch": "npx tailwindcss -i ./assets/style.css -o ./output/style.css --watch",
"styles:build": "npx tailwindcss -i ./assets/style.css -o ./output/style.css"
}
}