joe-bell / cva

Class Variance Authority
https://cva.style
Apache License 2.0
5.46k stars 107 forks source link

Feature Request #298

Closed abolfazlakbarzadeh closed 3 weeks ago

abolfazlakbarzadeh commented 3 weeks ago

Assume we want when some conditions in compoundVariants met then set other variants, for example:

{
    variants: {
      type: {
        fill: "text-white",
        outline: "bg-transparent",
      },
      borderType: {
        solid: "border-solid",
        dashed: "border-dashed",
      },
    },
    defaultVariants: {
      type: "fill"
    },
    compoundVariants: [
      {
        type: "outline",
        setVariants: { 
              borderType: "dashed" // HERE
          }
      }
    ]
  }