github chakra-ui/panda @pandacss/config@0.15.2

latest releases: @pandacss/types@0.49.0, @pandacss/token-dictionary@0.49.0, @pandacss/generator@0.49.0...
15 months ago

Patch Changes

  • 2645c2d: > Note: This is only relevant for users using more than 1 custom defined preset that overlap with each
    other.

    BREAKING CHANGE: Presets merging order felt wrong (left overriding right presets) and is now more intuitive (right
    overriding left presets)

    Example:

    const firstConfig = definePreset({
      theme: {
        tokens: {
          colors: {
            'first-main': { value: 'override' },
          },
        },
        extend: {
          tokens: {
            colors: {
              orange: { value: 'orange' },
              gray: { value: 'from-first-config' },
            },
          },
        },
      },
    })
    
    const secondConfig = definePreset({
      theme: {
        tokens: {
          colors: {
            pink: { value: 'pink' },
          },
        },
        extend: {
          tokens: {
            colors: {
              blue: { value: 'blue' },
              gray: { value: 'gray' },
            },
          },
        },
      },
    })
    
    // Final config
    export default defineConfig({
      presets: [firstConfig, secondConfig],
    })

    Here's the difference between the old and new behavior:

    {
      "theme": {
        "tokens": {
          "colors": {
            "blue": {
              "value": "blue"
            },
    -        "first-main": {
    -          "value": "override"
    -        },
            "gray": {
    -          "value": "from-first-config"
    +          "value": "gray"
            },
            "orange": {
              "value": "orange"
            },
    +        "pink": {
    +            "value": "pink",
    +        },
          }
        }
      }
    }
  • Updated dependencies [26a788c]

    • @pandacss/types@0.15.2
    • @pandacss/preset-base@0.15.2
    • @pandacss/preset-panda@0.15.2
    • @pandacss/error@0.15.2
    • @pandacss/logger@0.15.2

Don't miss a new panda release

NewReleases is sending notifications on new releases.