theme-ui
theme-ui copied to clipboard
Proper typescript support
Is your feature request related to a problem? Please describe.
Hi. I am frustrated with lack of proper typescript support. Official docs recommends to use get
function to access theme properties. It seems very unsafe, because get
method basically disables the whole typescript support - it allows me to access to non-existing value and doesn't provide the explicit return type. Also, the Theme
type seems not very useful - it does not represent the exact theme, and all of the properties are optional. I even cant add my own color, because of type incompatibility (see the screenshot). Could you please recommend me something in this situation?
Describe the solution you'd like
Allow user to extend / specify properly the exact Theme type. get
function just workarounds the whole types and can cause a lot of bugs.
Additional context
Cant extend the theme-ui with my own colors:
Cant specify my own theme type:
https://theme-ui.com/guides/typescript/#typescript
Probably we can close this?Cc: @hasparus