v3.0.0
Breaking Changes:
- Added a distinction between
colors
andthemes
- Updated
defaultTheme
prop to default tothemes.auto
- Updated context with
theme
(as active theme),color
(as active color),themes
(as object with supported themes), andcolor
(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 onprefers-color-scheme
andundefined
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
andmatchMedia.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 totheme.helper.js
- Added
flipThemeByColor()
- Added prettier
- Updated inline script in
AntiFlickerScript
- Moved
device.mock.js
to__tests__/mocks
folder - Moved
isServer()
toenv.helper.js
- Renamed
applyPreference()
toapplyTheme()
- Renamed
setPreference()
tosaveTheme()
- Renamed
getPreference()
togetTheme()