CLI
The command line interface for Stilvoll. Made for tech-stacks not using a Javascript build pipeline, so it’s the perfect fit for Kirby, Wordpress, etc.
Installation
-
Install
stilvolland@stilvoll/cliTerminal window npm install -D stilvoll @stilvoll/cli -
Create a
stilvoll.config.jsfile by either runningstilvoll init, or by manually setting up a config file:stilvoll.config.js export default {input: ["./src/index.css"],// When using the CLI you'll need to define// an output pathoutput: "./dist/utils.css",// By default the glob shown below is used to// find any files to parse for utility classes// used. You might need to tweak this, based// on your setupentries: ["**/*.{html,js,ts,jsx,tsx,vue,svelte,astro,elm,php,phtml,mdx,md}",],rules: [// Define or use imported rules here],}; -
Run the CLI to generate your utility CSS.
Terminal window stilvoll
You can also run the CLI in watch mode, so changes made to your CSS or markup files trigger a rebuild.
stilvoll --watch…or set them up as npm scripts
{ "scripts": { "dev": "stilvoll --watch", "build": "stilvoll" }, "devDependencies": { "@stilvoll/cli": "latest", "stilvoll": "latest" }}Options
| Options | |
|---|---|
-v, --version | Display the current version of Stilvoll |
-w, --watch | Run in watch mode, file changes trigger a rebuild |
-t, --types | Generate type definitions only, skipping CSS output |
--verbose | Output additional debug information |
--dry | Dry run, don’t write any files |