How to type a custom color #87
-
Hello, I would like to know how to type custom colors in Tailwindest.
tailwind.config.ts :
The problem is that Tailwindest["color"] does not take into account the custom colors contained in tailwind.config.ts. Type error : tailwind version 3.3.6 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Oh you can add custom properties with export type Tw = Tailwindest<{
color: "primary" | "secondary" | "tertiary" | "accent"
}>
// access background color
type Bg = Tw["backgroundColor"] |
Beta Was this translation helpful? Give feedback.
Oh you can add custom properties with
Tailwindest
type's generic argument like this. Happy coding :)