tailwind-bundle
v1.0.1
Published
Usually, Tailwind should be built on the fly. But sometimes, you need to bundle it up and save it.
Readme
Usually, Tailwind should be built on the fly. But sometimes, you need to bundle it up and save it.
To install:
npm install tailwind-bundle --saveAnd the paramaters are:
tailwind(html, config, tailwindConfig)Here's som examples:
const tailwind = require('tailwind-bundle');
const tailwindConfig = { ... }; // This is the config https://tailwindcss.com/docs/configuration (content is ignored)
tailwind('<div class="bg-blue-300"></div>', { selector: '.test' }, tailwindConfig).then(r => console.log(r.css));Or you can await using:
await tailwind('<div class="bg-blue-300"></div>', { selector: '.test' }, tailwindConfig);Here's the config options:
- selector Prefix each generated selector with this, for the sake of scoping (default: '')
- includeBase This will include
@tailwind base, which resets a lot of CSS (default: false)
