-
For example, let's say you have font weights tokens defined in import { defineConfig } from "@pandacss/dev";
import type { Tokens } from "@pandacss/types";
export const fontWeights: Tokens["fontWeights"] = {
thin: { value: "100" },
light: { value: "300" },
normal: { value: "400" },
medium: { value: "500" },
bold: { value: "700" },
};
export default defineConfig({
// ...
theme: {
extend: {
tokens: {
fontWeights,
},
},
},
}); I would like to extract the keys from the tokens to define prop types for my components instead of repeating myself like this: function SomeComponent({ fontWeight }: { fontWeight: "thin" | "light" | "normal" | "medium" | "bold" }) {
// ...
} If |
Beta Was this translation helpful? Give feedback.
Answered by
anubra266
Jan 8, 2025
Replies: 2 comments
-
@DaleSeo |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
DaleSeo
-
Thanks so much, @anubra266! This works like a charm! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@DaleSeo
https://play.panda-css.com/DvC0dSJe8R/xmL79a-Jn-?tab=config