unplugin-jade-garden
Version:
Build tool plugin for creating CSS with Jade Garden
33 lines (30 loc) • 1.14 kB
text/typescript
import { JadeGarden } from 'jade-garden';
type CVA = JadeGarden.CVAConfig<any>;
type Options = {
/**
* The relative path to the main CSS/Tailwind file where the generated `@apply`
* directives will be written. This file should typically reside in a
* dedicated styling directory (e.g., `css`, `styles`).
*
* Example: `./styles/components.css`
*/
entry?: string;
/**
* An object containing arrays of your `jade-garden` CVA and SVA configurations.
* The plugin will process these configurations to generate the corresponding CSS.
*/
components?: {
cva?: CVA[];
sva?: SVA[];
};
/**
* An optional custom class merging function. If not provided, the plugin
* will use `jade-garden`'s default `cx` utility for merging generated class names.
* You might provide this if you are using `tailwind-merge` or a similar utility
* to handle class conflicts.
*/
mergeFn?: JadeGarden.MergeClassFn;
};
type PluginInstance<T> = (options?: Options | undefined) => T;
type SVA = JadeGarden.SVAConfig<any, any>;
export type { PluginInstance as P };