Skip to content

Commit ed6afdd

Browse files
committed
feat: [#421] NuxtJs color mode config added
1 parent f78bc3f commit ed6afdd

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

nuxt.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,22 @@ export default defineNuxtConfig({
1111
},
1212

1313
modules: [
14-
"@nuxtjs/tailwindcss"
14+
"@nuxtjs/tailwindcss",
15+
"@nuxtjs/color-mode"
1516
],
1617

18+
colorMode: {
19+
preference: "system", // default value of $colorMode.preference
20+
fallback: "light", // fallback value if not system preference found
21+
hid: "nuxt-color-mode-script",
22+
globalName: "__NUXT_COLOR_MODE__",
23+
componentName: "ColorScheme",
24+
classPrefix: "",
25+
classSuffix: "",
26+
storageKey: "nuxt-color-mode",
27+
dataValue: "theme"
28+
},
29+
1730
vite: {
1831
server: {
1932
fs: {

tailwind.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module.exports = {
3333
}
3434
]
3535
},
36+
darkMode: "class",
3637
plugins: [
3738
require("daisyui"),
3839
require("@tailwindcss/typography")

0 commit comments

Comments
 (0)