Skip to content

Commit 5ecf41b

Browse files
Cedric0852claude
authored andcommitted
docs: add Panda CSS to styling your components guide
Adds a Panda CSS setup guide alongside the existing styling options (SASS, LESS, CSS Modules, Macaron, Tailwind, UnoCSS): - New guide page at /guides/styling-components/panda-css covering installation, PostCSS setup, config, cascade layers, and usage - Panda CSS card in the CSS-in-JS section of the overview page - Panda logo asset (official logomark from chakra-ui/panda) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 7ec650b commit 5ecf41b

7 files changed

Lines changed: 126 additions & 4 deletions

File tree

osmium/src/ui/image-link.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const logos: { [key: string]: { file: string; style?: string } } = {
1818
less: { file: "less.svg" },
1919
cssmodules: { file: "css-modules.svg", style: "invert" },
2020
macaron: { file: "macaron.svg" },
21+
panda: { file: "panda.svg" },
2122
tailwind: { file: "tailwind.svg" },
2223
stormkit: { file: "stormkit.svg" },
2324
sst: { file: "sst.svg" },

public/assets/panda.svg

Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: Panda CSS
3+
category: Guides / Styling Components
4+
order: 5
5+
mainNavExclude: true
6+
use_cases: >-
7+
styling components, css-in-js, build-time styles, design tokens, type-safe
8+
styles
9+
tags:
10+
- styling
11+
- css
12+
- panda
13+
- css-in-js
14+
- postcss
15+
- tokens
16+
version: "1.0"
17+
description: >-
18+
Set up Panda CSS in your Solid app for build-time CSS-in-JS. Configure
19+
PostCSS, define design tokens, and write type-safe styles.
20+
---
21+
22+
[Panda CSS](https://panda-css.com/) is a build-time CSS-in-JS library that combines the developer experience of CSS-in-JS with the performance of atomic CSS.
23+
Styles are extracted at build time through PostCSS, so no runtime styling code ships to the browser.
24+
25+
## Installation
26+
27+
1. Install Panda CSS as a development dependency:
28+
29+
```package-install-dev
30+
@pandacss/dev
31+
```
32+
33+
2. Initialize Panda CSS in your project.
34+
This creates a `panda.config.ts` file and a `postcss.config.cjs` file:
35+
36+
```package-exec
37+
panda init --postcss
38+
```
39+
40+
3. Add the `prepare` script to your `package.json`, which generates the `styled-system` directory after installs:
41+
42+
```json title="package.json"
43+
{
44+
"scripts": {
45+
"prepare": "panda codegen",
46+
"dev": "vite",
47+
"build": "vite build"
48+
}
49+
}
50+
```
51+
52+
## Configure Panda CSS
53+
54+
Open `panda.config.ts` and make sure the `include` patterns match your source files.
55+
Setting `jsxFramework` to `"solid"` enables Solid-specific JSX style props support:
56+
57+
```ts title="panda.config.ts"
58+
import { defineConfig } from "@pandacss/dev";
59+
60+
export default defineConfig({
61+
preflight: true,
62+
include: ["./src/**/*.{js,jsx,ts,tsx}"],
63+
exclude: [],
64+
jsxFramework: "solid",
65+
outdir: "styled-system",
66+
});
67+
```
68+
69+
## Import the cascade layers
70+
71+
Add the Panda CSS cascade layers to your `src/index.css` file:
72+
73+
```css title="src/index.css"
74+
@layer reset, base, tokens, recipes, utilities;
75+
```
76+
77+
Then import your `index.css` file into the root `index.jsx` or `index.tsx` file:
78+
79+
```jsx
80+
/* @refresh reload */
81+
import { render } from "solid-js/web"
82+
import "./index.css"
83+
import App from "./App"
84+
85+
render(() => <App />, document.getElementById('root') as HTMLElement);
86+
```
87+
88+
## Usage
89+
90+
With Panda CSS set up, use the `css` function from the generated `styled-system` directory to style your components:
91+
92+
```jsx
93+
/* src/App.jsx */
94+
import { css } from "../styled-system/css";
95+
96+
function App() {
97+
return (
98+
<div class={css({ fontSize: "2xl", fontWeight: "bold" })}>
99+
Hello from Panda! 🐼
100+
</div>
101+
);
102+
}
103+
104+
export default App;
105+
```
106+
107+
## Support
108+
109+
For additional assistance, refer to the [Panda CSS installation guide](https://panda-css.com/docs/installation/vite).

src/routes/(2)guides/(0)styling-components/tailwind-v3.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Tailwind CSS v3
33
category: Guides / Styling Components
4-
order: 7
4+
order: 8
55
mainNavExclude: true
66
use_cases: >-
77
utility-first css, rapid prototyping, responsive design, consistent styling,

src/routes/(2)guides/(0)styling-components/tailwind.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Tailwind CSS
33
category: Guides / Styling Components
4-
order: 5
4+
order: 6
55
mainNavExclude: true
66
use_cases: >-
77
styling components, utility classes, rapid ui development, responsive design,

src/routes/(2)guides/(0)styling-components/uno.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: UnoCSS
33
category: Guides / Styling Components
4-
order: 6
4+
order: 7
55
mainNavExclude: true
66
use_cases: >-
77
styling components, utility css, on-demand styles, vite integration, atomic

src/routes/(2)guides/(0)styling-your-components.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,21 @@ Many also offer features like theming, media queries, and server-side rendering
5454

5555
**Note:** Before choosing a CSS-in-JS library, it is recommended to check its compatibility with Solid.
5656

57-
### Macaron
57+
<div class="flex flex-col md:grid md:grid-cols-2 md:grid-rows-1 gap-3">
5858

5959
<ImageLink
6060
title="Macaron"
6161
href="/guides/styling-components/macaron"
6262
logo="macaron"
6363
/>
64+
<ImageLink
65+
title="Panda CSS"
66+
href="/guides/styling-components/panda-css"
67+
logo="panda"
68+
/>
69+
70+
</div>
71+
6472
## CSS frameworks
6573

6674
CSS frameworks provide pre-styled components and utility classes to speed up development.

0 commit comments

Comments
 (0)