Skip to content

v0.6.0

Compare
Choose a tag to compare
@joe-bell joe-bell released this 27 Apr 14:02
· 76 commits to main since this release
f23274e

What's Changed

  • cxclsx by @joe-bell in #152

    cva now uses clsx under-the-hood to concatenate classes with no breaking changes to the current experience and no increase to bundle-size.

    The existing cx export still exists, but as an alias of clsx

    Bringing additional benefits of:

    1. Provides additional support for booleans and variadic strings within class or className props

      const button = cva([true && "button-base", false && "not-rendered"]);
      // => 'button-base'
      
      const buttonConsumer = button({ class: [true && "extra-class"] });
      // => 'button-base extra-class'
    2. Provides support for object syntax within class or className props

      const button = cva({ foo: true, bar: false });
      // => 'foo baz'

Full Changelog: v0.5.3...v0.6.0