frenic / csstype

Strict TypeScript and Flow types for style based on MDN data
MIT License
1.7k stars 69 forks source link

How can I extend the types of the CSS property values? #145

Closed joseDaKing closed 2 years ago

joseDaKing commented 2 years ago

How can I extend the types of the CSS property values so I can support typings for my design tokens ?

dfernandez79 commented 2 years ago

Hi @joseDaKing in TS you can't extend type aliases. But, you can create your own interfaces that use csstype and your design tokens. This is the approach used by styled-system and I did the same in my design system. Hope it helps.