Skip to content

Programmatic Usage

Installation

  1. Install and @stilvoll/core

    Terminal window
    npm install -D @stilvoll/core
  2. Import and use generateUtilities and generateCSS

    import { generateUtilities, generateCSS } from "@stilvoll/core";
    /**
    * Generate a set of utilities from rules
    */
    const utilities = generateUtilities({
    rules: [["hidden", { display: "none" }]],
    breakpoints: [
    {
    name: "md",
    media: "@media screen and (min-width: 768px)",
    },
    ],
    });
    /**
    * Turn the utilities into a string of CSS.
    */
    const css = generateCSS(utilities);

Examples