joe-bell / cva

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

prevent single compoundVariant #263

Closed abernier closed 9 months ago

abernier commented 9 months ago

Currently, it is possible (without any TS warning) to use compoundVariants with a single prop:

cva("base", {
  variants: {}
  compoundVariants: [
    {
      size: "big",
      css: "..."
    }
  ]
})

IMO it should go into variants if only one prop like here.

What about adding type-safety to prevent this?

joe-bell commented 9 months ago

https://github.com/joe-bell/cva/blob/main/.github/ISSUE_TEMPLATE/bug_report.md?plain=1#L11