github chakra-ui/panda @pandacss/token-dictionary@0.25.0

latest releases: @pandacss/types@0.53.0, @pandacss/preset-panda@0.53.0, @pandacss/token-dictionary@0.53.0...
13 months ago

Minor Changes

  • de282f6: Support token reference syntax when authoring styles object, text styles and layer styles.

    import { css } from '../styled-system/css'
    
    const styles = css({
      border: '2px solid {colors.primary}',
    })

    This will resolve the token reference and convert it to css variables.

    .border_2px_solid_\{colors\.primary\} {
      border: 2px solid var(--colors-primary);
    }

    The alternative to this was to use the token(...) css function which will be resolved.

    token(...) vs {...}

    Both approaches return the css variable

    const styles = css({
      // token reference syntax
      border: '2px solid {colors.primary}',
      // token function syntax
      border: '2px solid token(colors.primary)',
    })

    However, The token(...) syntax allows you to set a fallback value.

    const styles = css({
      border: '2px solid token(colors.primary, red)',
    })

Patch Changes

  • Updated dependencies [59fd291]
    • @pandacss/types@0.25.0
    • @pandacss/shared@0.25.0

Don't miss a new panda release

NewReleases is sending notifications on new releases.