Skip to content

@tw-classed/react@1.4.0-canary.5

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 18 Jan 23:42
· 133 commits to master since this release
3851798

Patch Changes

  • 785bcaaa Thanks @sannajammeh! - Adds support for compoundVariants to be inherit via the composition API.

    Example:

    const Button = classed.button({
      base: "bg-blue-500 text-white",
      variants: {
        size: {
          sm: "px-2 py-1 text-sm",
          md: "px-4 py-2 text-base",
        },
        color: {
          red: "bg-red-500",
          green: "bg-green-500",
        },
      },
      compoundVariants: [
        {
          size: "sm",
          color: "green"
          class: "super-special-class-modifyer"
        },
      ],
    });
    
    const GreenButton = classed(Button, {
      defaultVariants: {
        color: "green", // This now triggers the compoundVariant
      },
    });
  • Updated dependencies [785bcaaa]:

    • @tw-classed/core@1.4.0-canary.5