github joe-bell/cva v0.6.0

latest releases: v1.0.0-beta.4, v1.0.0-beta.3, v1.0.0-beta.2...
2 years ago

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

Don't miss a new cva release

NewReleases is sending notifications on new releases.