You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-8Lines changed: 39 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,9 +68,9 @@ Which will produce:
68
68
69
69
---
70
70
71
-
### Supported Syntax
71
+
### Supported syntax
72
72
73
-
This plugin supports aliasing to Panda's object syntax via a `value` key, just as you would define semantic tokens in Panda's theme.
73
+
This plugin supports aliasing to Panda's object syntax via a `value` key, just as you would define semantic tokens in Panda's theme. Anything Panda supports will work, including raw values.
There are alternatives to achieve the same result.
112
+
This plugin generates a performant JS runtime to map paths to their respective class names. This runtime can be completely removed using [@pandabox/unplugin](https://github.com/astahmer/pandabox/tree/main/packages/unplugin), with a transformer exported from this package. Your bundler's config will need to be modified to achieve this.
113
113
114
-
- Use Panda's `importMap` in config to reference your own alias to token mapping.
115
-
- Use `@pandabox/unplugin` to strip out and remove your own alias mapping at build time.
114
+
Example Next.js config:
115
+
116
+
```js
117
+
import unplugin from '@pandabox/unplugin';
118
+
import {transform} from 'panda-plugin-ct';
119
+
120
+
// Your token object
121
+
// This should be the same as the object you supplied to the Panda plugin
122
+
const tokens = {};
123
+
124
+
/** @type {import('next').NextConfig} */
125
+
const nextConfig = {
126
+
reactStrictMode: true,
127
+
webpack: (config) => {
128
+
config.plugins.push(
129
+
unplugin.webpack({
130
+
transform: transform(tokens),
131
+
optimizeJs: true, // Optional, this will replace other Panda runtime functions (css, cva, etc)
132
+
}),
133
+
);
134
+
returnconfig;
135
+
},
136
+
};
137
+
138
+
export default nextConfig;
139
+
```
140
+
141
+
---
142
+
143
+
### Acknowledgement
144
+
145
+
- [Jimmy](https://github.com/jimmymorris) – for the idea and motivation behind the plugin
146
+
- [Alex](https://github.com/astahmer) – for providing feedback with the plugin's internals and functionality
0 commit comments