Why Panda
What Panda is, and what you get from writing styles this way.
What is Panda
Panda is a styling engine. You write styles in TypeScript, and Panda generates plain atomic CSS at build time.
It reads your source rather than running in the browser: static analysis picks up JSX style props and function calls, and only the styles you actually used end up in the stylesheet. You get the authoring experience of CSS-in-JS without shipping a style engine to your users.
There is more than one way to write it. Every tab below produces the same atomic CSS.
How it works
Panda runs two passes at build time, so the browser never computes styles:
- Codegen reads your config and writes the
styled-systempackage you import from. - Extract scans your source for those calls and emits only the CSS you used.
panda.config.ts css({ color: 'blue.500' })
│ │
▼ ▼
codegen extract
│ │
▼ ▼
styled-system/ styles.css
(css, cva, …) .color_blue\.500 { … }
│ │
└────────────────┬───────────────────┘
▼
browser
class name string + static CSS
Values have to be visible in source. If a style only exists at runtime, see Dynamic Styles. Folder details: Styled System.
What you get
- Static analysis: Panda parses your styles at build time and generates plain CSS files that work in any JavaScript framework.
- Type safety: Panda combines
csstypewith auto-generated typings, so CSS properties and design tokens are type-checked as you write them. - Performance: styles compile down to atomic CSS ahead of time, so there's no runtime style engine shipped to the browser.
- Developer experience: recipes, patterns, design tokens, and JSX style props give you a consistent way to author styles without hand-rolling your own system.
- Modern CSS: generated styles use cascade layers, CSS variables, and modern selectors like
:whereand:is.
Where to go next
Panda installs as a CLI tool, a PostCSS plugin, through a framework-specific guide, or inside Storybook.
Playground
You can use the online playground (opens in a new tab) to get a taste of what Panda can do.
- See the live results of your JSX code
- Inspect what panda can extract using static analysis from your code
- Preview the statically generated
.cssfiles
Acknowledgement
The development of Panda was only possible due to the inspiration and ideas from these amazing projects.
- Chakra UI (opens in a new tab) - where it all started
- Vanilla Extract (opens in a new tab) - for inspiring the utilities API
- Stitches (opens in a new tab) - for inspiring the recipes and variants API
- Tailwind CSS (opens in a new tab) - for inspiring the JIT compiler and strategy
- Class Variance Authority (opens in a new tab) - for inspiring the
cvaname - Styled System (opens in a new tab) - for the initial idea of Styled Props
- Linaria (opens in a new tab) - for inspiring the initial atomic css strategy
- Uno CSS (opens in a new tab) - for inspiring the studio and astro integration