yarcl
    Preparing search index...

    Function defineConfig

    • Declares a yarcl design system config.

      Checks at compile time that:

      • every color has a light and dark value
      • defaults, focusRing.color, typography.headings and each text style's family reference existing keys
      • no key contains whitespace
      • components only names known components, only sets props they have, and only uses existing keys

      Returns the config unchanged with literal types preserved, so the library can derive its prop types from it. Spread yarcl/defaults to extend the library defaults instead of replacing them.

      Type Parameters

      Parameters

      • config: T & Checks<T>

      Returns T

      // src/yarcl.config.ts
      import { defineConfig } from 'yarcl/define';
      import defaults from 'yarcl/defaults';

      export default defineConfig({
      ...defaults,
      colors: { ...defaults.colors, brand: { light: '#2d4bb8', dark: '#8aa2ff' } },
      defaults: { ...defaults.defaults, color: 'brand' },
      });