Skip to content

v6.7.0

Choose a tag to compare

@brandongregoryscott brandongregoryscott released this 11 Jan 18:46
· 165 commits to master since this release
  • Generic Theme types, strongly typed DefaultTheme + theme utilities (#1382) 98e49a4

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 theme
  • DefaultTheme extends Theme and provides better direction on what appearances/sizes the defaultTheme has
  • useTheme() is now generic (set to DefaultTheme unless otherwise specified)
  • Similarly, ThemeContext is now generic, and a custom typed version of it can be retrieved with the new exported function getThemeContext() (set to DefaultTheme 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 the defaultTheme

For examples on usage, check out the index.d.ts test file or the description of #1382

v6.6.5...v6.7.0