Skip to content

Commit

Permalink
docs: update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jonambas committed Apr 6, 2024
1 parent 4262ced commit fc816a6
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { css, ct } from "../../styled-system/css";
// Token paths are fully typed
background: ct('alert.background')
})}>

```

Which will produce:
Expand Down Expand Up @@ -66,3 +65,44 @@ Which will produce:
background: var(--colors-alert-background);
}
```

---

### Supported Syntax

This plugin supports aliasing to Panda's object syntax via a `value` key, just as you would define styles with conditions in Panda's theme.

```ts
// panda.config.ts

export default defineConfig({
plugins: [
pluginComponentTokens({
alert: {
background: {
value: {
base: 'red.500',
lg: 'blue.500',
},
},
text: {
value: 'gray.100',
},
},
}),
],
});
```

```tsx
<div className={css({
background: ct('alert.background'),
color: ct('alert.text'),
})}>
```

Produces:

```html
<div class="bg_red.500 text_gray.900 lg:text_gray.300" />
```

0 comments on commit fc816a6

Please sign in to comment.