github segmentio/evergreen v6.7.0

latest releases: v7.1.9, v7.1.8, v7.1.7...
2 years ago
  • 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

Don't miss a new evergreen release

NewReleases is sending notifications on new releases.