Major Changes
-
1ca20ab: Remove
definePartsand theParts/Parttypes. Write the part selectors directly in your recipe, or use
defineSlotRecipefor 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
strictTokensstill applies. Config recipes importfirstThatWorksfrom@pandacss/dev, or write the
firstThatWorks(a, b)value form directly.