@nuxtjs/color-mode
4.1.0 · 27 Oct 2026MIT1.3M / weekRepositoryHomepagenpmAtom feed
3.5.2 is the newest release of 3.x.
In short
4 breaking5 changed
- Breaking
Use
esbuildto minify the script - note: ⚠️ it's likely this raises the minimum browser target ⚠️ - Breaking
The main change between Nuxt 2 -> Nuxt 3 is that you will define your color mode at the page level with
definePageMeta: - Breaking
The
$colorModehelper remains the same, but there is also a new composable (useColorMode) which is the recommended way of accessing color mode information. - Breaking
If you were directly importing color mode configuration types, note that this has been renamed to
ModuleOptions.
Release note
v3 of @nuxtjs/color-mode requires either Nuxt Bridge or Nuxt 3. If you are using Nuxt 2 without Bridge, you should continue to use v2.
Notable changes
Uses
@nuxt/module-builderto build module.Refactor structure (
lib->src/dist,templates->runtime)Rewrite in TypeScript
Move from templating options to creating a virtual module for greater performance
- Breaking
Use
esbuildto minify the script - note: ⚠️ it's likely this raises the minimum browser target ⚠️
Migration
- Breaking
The main change between Nuxt 2 -> Nuxt 3 is that you will define your color mode at the page level with
definePageMeta:<template> <h1>This page is forced with light mode</h1> </template> <script> - export default { - colorMode: 'light', - } + definePageMeta({ + colorMode: 'light', + }) </script>⚠️ If you are using Nuxt Bridge, you should not use
definePageMetabut instead continue using the component optioncolorMode. - Breaking
The
$colorModehelper remains the same, but there is also a new composable (useColorMode) which is the recommended way of accessing color mode information. - Breaking
If you were directly importing color mode configuration types, note that this has been renamed to
ModuleOptions.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.