Loading...
Loading...
Write and edit styles in a project that uses Panda CSS. Use when creating, changing, or reviewing code that calls css(), cva(), sva(), patterns, recipes, tokens, conditions, or JSX style props, when a style renders a class name but no CSS, or when styles do not apply at all. Covers Panda v2 (2.x) and v1 (1.x). Do not use for designing the theme or deciding when something becomes a recipe or slot recipe (use panda-css-theming), or for upgrading v1 to v2 (use panda-css-migrate).
npx skill4agent add chakra-ui/panda panda-css@pandacss/devpackage.json1.x2.x-betapanda.config.ts.js.mjsoutdirstyled-systemincludejsxFrameworkstrictTokenspresetsdesignSystem<outdir>/types/tokens.d.tspanda codegen<outdir>/specs/design-system.jsonpanda codegen --spec--specbuildlib<outdir>/recipes/<outdir>/patterns/panda doctor --jsonbrand.primaryhttps://panda-css.com/llms.txt/get-started/llms.txt/styling/llms.txt/theming/llms.txt/design-systems/llms.txt/reference/llms-full.txtcsscvasvacxstyledimport { css } from '../styled-system/css'@pandacss/devdefineConfigdefineRecipedefineSlotRecipedefineTokensdefinePresetjsxFrameworkoutdirpanda codegen<outdir>/types/tokens.d.tsfg.mutedbg.subtlegray.600strictTokenscolor: '[#bada55]'justifyContent: 'safe center'textWrap: 'pretty'scrollbarWidth: 'thin'// ❌ runtime value
css({ color: theme.accent })
// ❌ dynamic key
css({ [prop]: '4' })
// ❌ spread of a runtime object
css({ ...propsFromSomewhere })
// ✅ both branches literal
css({ color: isActive ? 'fg' : 'fg.muted' })includeinclude// styles.ts
export const button = css.raw({ px: '4', py: '2', rounded: 'md' })
// button.tsx
css(button, { bg: 'blue.500' })defaultVariantsrecipe_variant_dynamicstaticCsscss({ … })stackhstackgridcontainer<outdir>/patterns<outdir>/recipescva<Box px="4">styled.divjsxFramework_hover_focusVisible_dark_disabled{ base: '4', md: '6' }&// ❌ ignored
css({ svg: { color: 'fg' } })
// ✅
css({ '& svg': { color: 'fg' } })css(a, b)cx()utilitiesrecipescss.raw({ … })// the override loses, borderWidth re-applies every side
cx(css({ borderWidth: '1px' }), css({ borderInlineEnd: '0' }))
// the override wins
cx(css({ borderWidth: '1px' }), css({ borderInlineEndWidth: '0' }))className="flex items-center gap-2"className!importantincludepanda doctor --jsonincludepanda codegen@layer reset, base, tokens, recipes, utilities;recipe_variant_dynamicjsxFrameworkpanda debug<outdir>/debugpanda codegenpanda buildpanda dev@pandacss/eslint-plugin&include@pandacss/mcpnpx -y @pandacss/mcppanda buildrecipe_variant_dynamic<outdir>/types/tokens.d.tspanda doctor'[#bada55]'