joe-bell / cva

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

prevent single compoundVariant #263

Closed abernier closed 5 months ago

abernier commented 5 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 5 months ago

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