The theme types have been reworked to provide better direction on usage of the existing theme values or adding/overriding values.
Theme
is a very generic interface defining the expected shape/tokens of a themeDefaultTheme
extendsTheme
and provides better direction on what appearances/sizes thedefaultTheme
hasuseTheme()
is now generic (set toDefaultTheme
unless otherwise specified)- Similarly,
ThemeContext
is now generic, and a custom typed version of it can be retrieved with the new exported functiongetThemeContext()
(set toDefaultTheme
unless otherwise specified) - A new utility function,
mergeTheme
, has been provided to deeply merge properties onto a destination theme, which can be useful if you're only looking to add or override a few values from thedefaultTheme
For examples on usage, check out the index.d.ts test file or the description of #1382