github chakra-ui/panda @pandacss/types@2.0.0-beta.17

latest releases: @pandacss/rollup@2.0.0-beta.17, @pandacss/vite@2.0.0-beta.17, @pandacss/mcp@2.0.0-beta.17...
pre-release4 hours ago

Major Changes

  • 1ca20ab: Remove defineParts and the Parts / Part types. Write the part selectors directly in your recipe, or use
    defineSlotRecipe for a class per part.

    If you still want the helper, it's a few lines you can keep in your own config:

    const defineParts =
      <T extends Record<string, { selector: string }>>(parts: T) =>
      (config: Partial<Record<keyof T, SystemStyleObject>>): SystemStyleObject =>
        Object.fromEntries(Object.entries(config).map(([key, value]) => [parts[key].selector, value]))

Minor Changes

  • 5b9a056: Add firstThatWorks() for ordered CSS value fallbacks, so one property can carry a modern value and a
    supported one:

    import { css, firstThatWorks } from 'styled-system/css'
    
    css({ color: firstThatWorks('oklch(55% 0.18 250)', '#0057b8') })
    .c_firstThatWorks\(oklch\(55\%_0\.18_250\)\,_\#0057b8\) {
      color: #0057b8;
      color: oklch(55% 0.18 250);
    }

    Write the value you want first, as in StyleX. Members are typed by the property they sit in, so they autocomplete and
    strictTokens still applies. Config recipes import firstThatWorks from @pandacss/dev, or write the
    firstThatWorks(a, b) value form directly.

Don't miss a new panda release

NewReleases is sending notifications on new releases.