Skip to content

v0.4.0

Compare
Choose a tag to compare
@joe-bell joe-bell released this 05 Dec 08:02
· 106 commits to main since this release
8172d21

What's Changed

Features

  • Target Multiple Variant Options within Compound Variants by @joe-bell and @JeroenReumkens in #76

    // components/button.ts
    import { cva } from "class-variance-authority";
    
    const button = cva("…", {
      variants: {
        intent: { primary: "…", secondary: "…" },
        size: { small: "…", medium: "…" },
      },
      compoundVariants: [
        // Applied via:
        //   `button({ intent: "primary", size: "medium" })`
        //     or
        //   `button({ intent: "secondary", size: "medium" })`
        {
          intent: ["primary", "secondary"],
          size: "medium",
          class: "…",
        },
      ],
    });

Chores

New Contributors

Full Changelog: v0.3.0...v0.4.0