Everything the CLI does, you can do from JavaScript. The core is dependency-free and runs in Node and the browser.
CSSGenerator (v2)#
example.mjs
import { CSSGenerator } from 'nakshora';
const gen = new CSSGenerator({
theme: { colors: { brand: '#6d28d9' } },
});
const css = gen.generate({ minify: true });Key methods#
| Method | Returns |
|---|---|
generate(options) | Compiled CSS string (JIT when content is set) |
getVariables() | The :root CSS custom properties |
getKeyframes() | All animation keyframes |
