Misbehaving ThemeOverride definition
Opened this issue · 0 comments
The use of NonNullishPartialRecord
in ThemeOverride
only allows for Records as types, and forces all values of Records to be strings
This means that Records with number (or other) values like fontWeights do not work.
It also means that font, breakpoints and VariantValues (the latter two which should be, but aren't, defined on interface Theme
) of types string, array or string literal respectively do not work (because they are not Records).
This can be fixed by adding breakpoints and VariantValues (and maybe other missing?) to the interface Theme
, adding the type of the key to NonNullishPartialRecord
and the plain type as a type:
export type NonNullishPartialRecord<K, V = string> =
{ [key in keyof K]?: K[key] } & { [key: string]: V } | K
Somewhat relatedly, you might also want to reconsider defining objects and exporting their types with typeof
, and instead define interfaces for them, ensuring local type safety, but also some pretty cool options like instead of using string type for pixel values, you can do:
type Pixels = `${number}px`
I'm willing to give a hand with any and all of this, but I don't want to waste my time if you won't accept those changes :)