> [Agent navigation index](/llms.txt)

# 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](/docs/react-managed.md#understand-the-application-boundary)
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.ts` that default-exports
  `definePandaConfig(...)` from `brix/panda`.
- Generated utilities live in the ignored `styled-system/` directory and are imported through
  `#brix/panda/*`, for example `import { css } from "#brix/panda/css"`.
- Styled libraries publish their compiled styles and metadata; an application inherits one by
  naming it in `designSystem`.

## Recommended path

1. To style a component in an existing application, go straight to
   [component styling](/docs/styling-components.md). The default tokens and any theme the project
   already has are available immediately.
1. To establish shared colors, spacing, typography, dark mode, or breakpoints,
   [configure the theme](/docs/styling-theme.md).
1. To share components across applications, [publish a styled UI library](/docs/styling-components.md#publish-styled-ui-libraries)
   and [extend it through brand layers](/docs/styling-components.md#extend-base-brand-app).
