@maz-ui/nuxt 5.0.0-beta.5 → 5.0.0-beta.7
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 +10 -2
- package/package.json +5 -5
package/dist/module.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MazUiTheme } from "@maz-ui/themes/plugin";
|
|
2
|
-
import { CSS_ID, generateCSS, getPreset, mergePresets } from "@maz-ui/themes/utils";
|
|
2
|
+
import { CSS_ID, generateCSS, getPreset, mergePresets, resolveColorSchemeContent } from "@maz-ui/themes/utils";
|
|
3
3
|
import { getSystemColorMode } from "@maz-ui/themes/utils/get-color-mode";
|
|
4
4
|
import { defineNuxtPlugin, useCookie, useHead, useRequestHeaders } from "nuxt/app";
|
|
5
5
|
function getSavedColorMode() {
|
|
@@ -51,7 +51,7 @@ function injectThemeCSS(config) {
|
|
|
51
51
|
darkSelectorStrategy: config.darkModeStrategy,
|
|
52
52
|
prefix: "maz",
|
|
53
53
|
darkClass: config.darkClass,
|
|
54
|
-
|
|
54
|
+
lightClass: config.lightClass
|
|
55
55
|
});
|
|
56
56
|
useHead({
|
|
57
57
|
style: [{
|
|
@@ -96,6 +96,7 @@ export default defineNuxtPlugin(async ({ vueApp, $config }) => {
|
|
|
96
96
|
const config = {
|
|
97
97
|
strategy: "runtime",
|
|
98
98
|
darkClass: "dark",
|
|
99
|
+
lightClass: "light",
|
|
99
100
|
darkModeStrategy: "class",
|
|
100
101
|
mode: "both",
|
|
101
102
|
overrides: {},
|
|
@@ -114,6 +115,13 @@ export default defineNuxtPlugin(async ({ vueApp, $config }) => {
|
|
|
114
115
|
}
|
|
115
116
|
if (import.meta.server) {
|
|
116
117
|
injectThemeCSS(config);
|
|
118
|
+
useHead({
|
|
119
|
+
meta: [{
|
|
120
|
+
name: "color-scheme",
|
|
121
|
+
content: resolveColorSchemeContent(config.mode, config.colorMode),
|
|
122
|
+
id: "maz-color-scheme"
|
|
123
|
+
}]
|
|
124
|
+
});
|
|
117
125
|
if (config.colorMode === "auto" && config.mode === "both" && config.darkModeStrategy === "class") {
|
|
118
126
|
useHead({
|
|
119
127
|
script: [{ innerHTML: getColorModeBlockingScript(config), tagPosition: "head", id: "maz-color-mode-blocking" }],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maz-ui/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.0-beta.
|
|
4
|
+
"version": "5.0.0-beta.7",
|
|
5
5
|
"description": "Nuxt module for Maz-UI",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@nuxt/devtools-kit": "^3.2.3",
|
|
51
51
|
"@nuxt/kit": "^4.4.4",
|
|
52
52
|
"defu": "^6.1.7",
|
|
53
|
-
"@maz-ui/themes": "5.0.0-beta.
|
|
54
|
-
"@maz-ui/
|
|
55
|
-
"@maz-ui/
|
|
56
|
-
"maz-ui": "5.0.0-beta.
|
|
53
|
+
"@maz-ui/themes": "5.0.0-beta.7",
|
|
54
|
+
"@maz-ui/translations": "5.0.0-beta.6",
|
|
55
|
+
"@maz-ui/utils": "5.0.0-beta.6",
|
|
56
|
+
"maz-ui": "5.0.0-beta.7"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@nuxt/devtools": "^3.2.3",
|