Skip to content

@vanilla-extract/[email protected]

Choose a tag to compare

@seek-oss-ci seek-oss-ci released this 07 Sep 04:56
· 473 commits to master since this release
d101b43

Minor Changes

  • #334 0d8efe2 Thanks @markdalgleish! - Support multiple default conditions

    If your conditions are mutually exclusive (e.g. light mode and dark mode), you can now provide an array of default conditions. For example, the following configuration would automatically expand atoms({ background: 'white' }) to the equivalent of atoms({ background: { lightMode: 'white', darkMode: 'white' }}).

    import { createAtomicStyles } from '@vanilla-extract/sprinkles';
    
    const responsiveStyles = createAtomicStyles({
      conditions: {
        lightMode: { '@media': '(prefers-color-scheme: light)' },
        darkMode: { '@media': '(prefers-color-scheme: dark)' },
      },
      defaultCondition: ['lightMode', 'darkMode'],
      // etc.
    });