macaron-css / macaron

Compiler-augmented typesafe CSS-in-JS with zero runtime, colocation, maximum safety and productivity
https://macaron.js.org/
MIT License
735 stars 16 forks source link

Improve types. #12

Closed oSethoum closed 1 year ago

oSethoum commented 1 year ago

Auto complete doesn't seem to get the right object keys in the theme contract, is this intentional? image

Mokshit06 commented 1 year ago

Hi, the reason autocomplete isn't working is because createTheme has 2 overloads, createTheme(vars, debugId) and createTheme(contract, vars, debugId), and typescript isn't sure which overload you're using and can't show suggestions because of that. You can make it work by either adding a comma after the object like createTheme(contract, {},) or by passing an empty string as the third argument