Releases

v2.1.1 8/2/2021

  • fix: add script to webpack build (in dev) for storybook support (#99) · 54b482b

v2.1.0 8/2/2021

  • feat: add csp hash for color script (#94) · e2f1ffc
  • test: migrate to @nuxt/test-utils (#96) · 30dcff2
  • test: fill out additional test targets (#97) · 2ca9edc

v2.0.10 6/11/2021

  • fix: module stability (#92) · e9aa91c. resolves #89 and #91

v2.0.4 3/3/2021

Bug Fixes

  • types compatible with nuxt-property-decorator (#72) (43f5806)

v2.0.3 1/25/2021

  • fix: don't use window in created (#59) · 9b47c6e
  • fix(type-defs): make interface ColorModeInstance extend Vue (#62) · bac6667

v2.0.2 12/4/2020

Bug Fixes

  • type-defs: make all options optional (#56) (7d2aaff)

v2.0.1 12/2/2020

Bug Fixes

  • type-defs: add types reference to package (#52) (82592f4)

v2.0.0 10/13/2020

Notes

  • ⚠️  The breaking change is only if you are using the cookie option in the V1, if you don't use it, you can upgrade easily.
  • 📘  Read the updated documentation
  • 🎮  Checkout the updated demo

Force a color mode

You can force the color mode at the page level (only parent) by setting the colorMode property:

<template>
  <h1>This page is forced with light mode</h1>
</template>

<script>
export default {
  colorMode: 'light',
}
</script>

This feature is perfect for implementing dark mode to a website incrementally by setting the non-ready pages to colorMode: 'light'.

We recommend to hide or disable the color mode picker on the page since it won't be able to change the current page color mode, using $colorMode.forced value.

See example: https://color-mode.nuxtjs.app/light

Local Storage only

This will also fixes #38

Using a cookie is only worth for doing server-side rendering with no cache, where actually localStorage work in every-case and won't lead to a flash on client-side anyway.

This also simplify the options and reduce the dependency with the cookie package.

To customize the storage key, you now have to use the storageKey property instead of cookie.key.

v1.1.1 9/15/2020

Bug Fixes

  • types: add new options and include in package (00bb7e8)

v1.1.0 9/15/2020

Features

v1.0.3 8/4/2020

Bug Fixes

  • handle spa fallback (regression) (b92d64b), closes #21

v1.0.2 7/28/2020