Styling
Brix builds Panda CSS 2 into full-stack Preact applications, UI libraries, component tests, and managed Storybook. You write styles in TypeScript; Brix generates typed utilities and extracts only the CSS your source uses.
There is nothing to install or wire up: Brix pins Panda and runs its native Vite and Rollup
plugins for brix dev, brix build, brix test, and Storybook. Do not add PostCSS or a second
Panda version. Managed React applications
do not use this integration and keep their own CSS approach.
Three conventions cover most styling work:
- Configuration lives in one optional root
panda.config.tsthat default-exportsdefinePandaConfig(...)frombrix/panda. - Generated utilities live in the ignored
styled-system/directory and are imported through#brix/panda/*, for exampleimport { css } from "#brix/panda/css". - Styled libraries publish their compiled styles and metadata; an application inherits one by
naming it in
designSystem.
Recommended path
#- To style a component in an existing application, go straight to component styling. The default tokens and any theme the project already has are available immediately.
- To establish shared colors, spacing, typography, dark mode, or breakpoints, configure the theme.
- To share components across applications, publish a styled UI library and extend it through brand layers.