yarcl
    Preparing search index...

    Function yarcl

    • Vite plugin that connects the library to the consumer's config.

      • Aliases @yarcl/config to the consumer's config file (or the library default).
      • Generates virtual:yarcl.css from the config at build time: CSS variables on :root and one yarcl-{group}-{key} class per key. No inline styles, no runtime cost.
      • Warns when a color's foreground fails WCAG AA contrast.
      • Regenerates the CSS when the config file changes.

      Must be paired with a matching paths entry for @yarcl/config in the consumer's tsconfig.json, so the types resolve to the same file.

      Parameters

      Returns Plugin

      // vite.config.ts
      import { yarcl } from 'yarcl/plugin';

      export default defineConfig({
      plugins: [react(), yarcl({ config: 'src/yarcl.config.ts' })],
      });