Skip to content

v3.0.0

Compare
Choose a tag to compare
@designcise designcise released this 10 Dec 00:39
· 40 commits to main since this release

Breaking Changes:

  • Added a distinction between colors and themes
  • Updated defaultTheme prop to default to themes.auto
  • Updated context with theme (as active theme), color (as active color), themes (as object with supported themes), and color (as object with supported colors)
  • Removed colors from server-side and client-side package
  • Removed getColors()

Other Changes:

  • Added 'auto' theme
  • Added themes for server-side and client-side components
  • Added colors.auto option that automatically determines color scheme based on prefers-color-scheme and undefined for server
  • Added feature to automatically update theme if prefers-color-scheme changes
  • Added feature to automatically switch to the opposite color from whatever color is set by 'auto' mode
  • Added localStorage.mock.js and matchMedia.mock.js
  • Added ThemeAutoColor component for tests
  • Added tests for functions in theme.helper.js
  • Added tests for the 'auto' option
  • Added new tests + updated old ones
  • Added colors object to theme.helper.js
  • Added flipThemeByColor()
  • Added prettier
  • Updated inline script in AntiFlickerScript
  • Moved device.mock.js to __tests__/mocks folder
  • Moved isServer() to env.helper.js
  • Renamed applyPreference() to applyTheme()
  • Renamed setPreference() to saveTheme()
  • Renamed getPreference() to getTheme()