@maz-ui/nuxt 4.9.1-beta.3 → 4.9.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/plugins/theme.js +3 -10
- package/package.json +3 -3
package/dist/module.json
CHANGED
|
@@ -16,14 +16,7 @@ function getSavedResolvedColorMode() {
|
|
|
16
16
|
}
|
|
17
17
|
return void 0;
|
|
18
18
|
}
|
|
19
|
-
function getInitialColorMode(
|
|
20
|
-
if (colorMode && ["light", "dark"].includes(colorMode)) {
|
|
21
|
-
return colorMode;
|
|
22
|
-
}
|
|
23
|
-
const savedColorMode = getSavedColorMode();
|
|
24
|
-
if (savedColorMode && ["light", "dark"].includes(savedColorMode)) {
|
|
25
|
-
return savedColorMode;
|
|
26
|
-
}
|
|
19
|
+
function getInitialColorMode() {
|
|
27
20
|
const resolvedColorMode = getSavedResolvedColorMode();
|
|
28
21
|
if (resolvedColorMode) {
|
|
29
22
|
return resolvedColorMode;
|
|
@@ -83,16 +76,16 @@ export default defineNuxtPlugin(async ({ vueApp, $config }) => {
|
|
|
83
76
|
strategy: "hybrid",
|
|
84
77
|
darkClass: "dark",
|
|
85
78
|
darkModeStrategy: "class",
|
|
86
|
-
colorMode: getSavedColorMode() ?? options.colorMode ?? "auto",
|
|
87
79
|
mode: "both",
|
|
88
80
|
injectAllCSSOnServer: false,
|
|
89
81
|
injectCriticalCSS: true,
|
|
90
82
|
injectFullCSS: true,
|
|
91
83
|
overrides: {},
|
|
92
84
|
...options,
|
|
85
|
+
colorMode: getSavedColorMode() ?? options?.colorMode ?? "auto",
|
|
93
86
|
preset
|
|
94
87
|
};
|
|
95
|
-
const isDark = config.colorMode === "auto" && config.mode === "both" ? getInitialColorMode(
|
|
88
|
+
const isDark = config.colorMode === "auto" && config.mode === "both" ? getInitialColorMode() === "dark" : config.colorMode === "dark" || config.mode === "dark";
|
|
96
89
|
if (isDark && config.darkModeStrategy === "class") {
|
|
97
90
|
useHead({
|
|
98
91
|
htmlAttrs: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maz-ui/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.9.1-beta.
|
|
4
|
+
"version": "4.9.1-beta.4",
|
|
5
5
|
"description": "Nuxt module for Maz-UI",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@nuxt/kit": "^4.4.2",
|
|
52
52
|
"defu": "^6.1.4",
|
|
53
53
|
"@maz-ui/themes": "4.9.0",
|
|
54
|
-
"maz-ui": "4.
|
|
54
|
+
"@maz-ui/translations": "4.8.0",
|
|
55
55
|
"@maz-ui/utils": "4.7.6",
|
|
56
|
-
"
|
|
56
|
+
"maz-ui": "4.9.1-beta.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@nuxt/devtools": "^3.2.3",
|