@maz-ui/themes 4.0.0-beta.19 → 4.0.0-beta.24
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/README.md +1 -1
- package/dist/build/index.js +34 -30
- package/dist/composables/useTheme.js +60 -48
- package/dist/plugin/index.js +3 -2
- package/dist/plugin.js +21 -28
- package/dist/presets/pristine.js +4 -4
- package/dist/types/composables/useTheme.d.ts +4 -126
- package/dist/types/composables/useTheme.d.ts.map +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/utils/css-generator.d.ts +5 -5
- package/dist/types/utils/css-generator.d.ts.map +1 -1
- package/dist/types/utils/get-color-mode.d.ts +1 -1
- package/dist/types/utils/get-color-mode.d.ts.map +1 -1
- package/dist/utils/css-generator.js +89 -67
- package/dist/utils/get-color-mode.js +8 -8
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/build/index.js
CHANGED
|
@@ -1,52 +1,56 @@
|
|
|
1
|
-
import { generateCriticalCSS as
|
|
2
|
-
function
|
|
1
|
+
import { generateCriticalCSS as o, generateFullCSS as d } from "../utils/css-generator.js";
|
|
2
|
+
function s(t) {
|
|
3
3
|
const {
|
|
4
4
|
preset: e,
|
|
5
|
-
mode:
|
|
5
|
+
mode: a = "both",
|
|
6
|
+
darkSelector: l = "class",
|
|
6
7
|
prefix: r = "maz",
|
|
7
|
-
criticalOnly:
|
|
8
|
-
} = t,
|
|
9
|
-
mode:
|
|
8
|
+
criticalOnly: i = !1
|
|
9
|
+
} = t, c = {
|
|
10
|
+
mode: a,
|
|
11
|
+
darkSelectorStrategy: l,
|
|
10
12
|
prefix: r
|
|
11
13
|
};
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
14
|
-
const
|
|
15
|
-
return `${
|
|
16
|
-
${
|
|
14
|
+
if (i)
|
|
15
|
+
return o(e, c);
|
|
16
|
+
const n = o(e, c), m = d(e, c);
|
|
17
|
+
return `${n}
|
|
18
|
+
${m}`;
|
|
17
19
|
}
|
|
18
20
|
function u(t, e = {}) {
|
|
19
21
|
const {
|
|
20
|
-
mode:
|
|
22
|
+
mode: a = "both",
|
|
23
|
+
darkSelector: l = "class",
|
|
21
24
|
prefix: r = "maz",
|
|
22
|
-
criticalOnly:
|
|
25
|
+
criticalOnly: i = !1
|
|
23
26
|
} = e;
|
|
24
|
-
return t.reduce((
|
|
25
|
-
preset:
|
|
26
|
-
mode:
|
|
27
|
+
return t.reduce((c, n) => (c[n.name] = s({
|
|
28
|
+
preset: n,
|
|
29
|
+
mode: a,
|
|
30
|
+
darkSelector: l,
|
|
27
31
|
prefix: r,
|
|
28
|
-
criticalOnly:
|
|
29
|
-
}),
|
|
32
|
+
criticalOnly: i
|
|
33
|
+
}), c), {});
|
|
30
34
|
}
|
|
31
35
|
function f(t, e = {}) {
|
|
32
|
-
const { id:
|
|
33
|
-
let
|
|
34
|
-
return
|
|
36
|
+
const { id: a = "maz-theme", media: l } = e;
|
|
37
|
+
let r = `<style id="${a}"`;
|
|
38
|
+
return l && (r += ` media="${l}"`), r += `>
|
|
35
39
|
${t}
|
|
36
|
-
</style>`,
|
|
40
|
+
</style>`, r;
|
|
37
41
|
}
|
|
38
|
-
function
|
|
39
|
-
const { prefix:
|
|
42
|
+
function h(t, e = {}) {
|
|
43
|
+
const { prefix: a = "maz", darkSelector: l = "class" } = e, r = { prefix: a, darkSelectorStrategy: l };
|
|
40
44
|
return {
|
|
41
|
-
critical:
|
|
42
|
-
full:
|
|
43
|
-
lightOnly:
|
|
44
|
-
darkOnly:
|
|
45
|
+
critical: o(t, { ...r, mode: "both" }),
|
|
46
|
+
full: d(t, { ...r, mode: "both" }),
|
|
47
|
+
lightOnly: s({ preset: t, mode: "light", ...e }),
|
|
48
|
+
darkOnly: s({ preset: t, mode: "dark", ...e })
|
|
45
49
|
};
|
|
46
50
|
}
|
|
47
51
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
h as buildSeparateThemeFiles,
|
|
53
|
+
s as buildThemeCSS,
|
|
50
54
|
f as createThemeStylesheet,
|
|
51
55
|
u as generateThemeBundle
|
|
52
56
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { setCookie as
|
|
3
|
-
import { generateCriticalCSS as
|
|
4
|
-
import { getColorMode as
|
|
5
|
-
import { getPreset as
|
|
6
|
-
import { mergePresets as
|
|
7
|
-
function
|
|
1
|
+
import { ref as M, computed as a, watchEffect as P, inject as h, getCurrentInstance as v, watch as C } from "vue";
|
|
2
|
+
import { setCookie as T } from "../utils/cookie-storage.js";
|
|
3
|
+
import { generateCriticalCSS as b, generateFullCSS as w, injectCSS as s, CSS_IDS as u } from "../utils/css-generator.js";
|
|
4
|
+
import { getColorMode as z, isSystemPrefersDark as L } from "../utils/get-color-mode.js";
|
|
5
|
+
import { getPreset as x } from "../utils/get-preset.js";
|
|
6
|
+
import { mergePresets as D } from "../utils/preset-merger.js";
|
|
7
|
+
function E() {
|
|
8
8
|
return typeof document > "u" || typeof globalThis.window > "u";
|
|
9
9
|
}
|
|
10
|
-
const r =
|
|
11
|
-
function
|
|
12
|
-
typeof document > "u" || !
|
|
10
|
+
const r = M();
|
|
11
|
+
function k(e) {
|
|
12
|
+
typeof document > "u" || !e || e.darkModeStrategy === "media" || e.mode === "light" || (e.isDark ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark"));
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const e =
|
|
14
|
+
function F() {
|
|
15
|
+
const e = v()?.appContext.app;
|
|
16
16
|
e && r.value && (e.config.globalProperties.$mazThemeState = r.value);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function I(e) {
|
|
19
19
|
if (e.currentPreset && e.colorMode !== void 0) {
|
|
20
|
-
|
|
20
|
+
l({
|
|
21
21
|
currentPreset: e.currentPreset,
|
|
22
22
|
colorMode: e.colorMode,
|
|
23
23
|
mode: e.mode,
|
|
@@ -27,8 +27,8 @@ function w(e) {
|
|
|
27
27
|
});
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
const t =
|
|
31
|
-
|
|
30
|
+
const t = z(e.colorMode), o = t === "auto" ? L() : t === "dark";
|
|
31
|
+
l({
|
|
32
32
|
currentPreset: e.currentPreset,
|
|
33
33
|
colorMode: t,
|
|
34
34
|
mode: e.mode,
|
|
@@ -37,61 +37,73 @@ function w(e) {
|
|
|
37
37
|
darkModeStrategy: e.darkModeStrategy
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function l(e) {
|
|
41
41
|
if (r.value = e, typeof globalThis.window < "u" && r.value.colorMode === "auto") {
|
|
42
42
|
const t = globalThis.matchMedia("(prefers-color-scheme: dark)"), o = () => {
|
|
43
43
|
r.value && r.value.colorMode === "auto" && (r.value.isDark = t.matches);
|
|
44
44
|
};
|
|
45
45
|
t.addEventListener("change", o), o();
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
r.value && (
|
|
47
|
+
P(() => {
|
|
48
|
+
r.value && (k(r.value), F());
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const c = a({
|
|
52
52
|
get: () => r.value?.colorMode,
|
|
53
|
-
set: (e) =>
|
|
54
|
-
}),
|
|
55
|
-
async function
|
|
53
|
+
set: (e) => n(e)
|
|
54
|
+
}), d = a(() => r.value?.isDark ?? !1), m = a(() => r.value?.strategy), f = a(() => r.value?.mode), g = a(() => r.value?.darkModeStrategy), p = a(() => r.value?.currentPreset.name);
|
|
55
|
+
async function U(e) {
|
|
56
56
|
if (!r.value)
|
|
57
57
|
return;
|
|
58
|
-
const t = typeof e == "string" ? await
|
|
58
|
+
const t = typeof e == "string" ? await x(e) : e, o = "name" in t && t.name !== r.value.currentPreset.name ? t : D(r.value.currentPreset, t);
|
|
59
59
|
if (r.value.currentPreset = o, r.value.strategy === "runtime" || r.value.strategy === "hybrid") {
|
|
60
|
-
const
|
|
60
|
+
const i = {
|
|
61
61
|
mode: r.value.mode,
|
|
62
|
+
darkSelectorStrategy: r.value.darkModeStrategy,
|
|
62
63
|
prefix: "maz"
|
|
63
|
-
},
|
|
64
|
-
u
|
|
64
|
+
}, y = b(o, i), S = w(o, i);
|
|
65
|
+
s(u.CRITICAL, y), s(u.FULL, S);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
r.value && (r.value.colorMode = e, e === "auto" ? r.value.isDark = typeof globalThis.window < "u" && globalThis.matchMedia("(prefers-color-scheme: dark)").matches : r.value.isDark = e === "dark",
|
|
68
|
+
function n(e) {
|
|
69
|
+
r.value && (r.value.colorMode = e, e === "auto" ? r.value.isDark = typeof globalThis.window < "u" && globalThis.matchMedia("(prefers-color-scheme: dark)").matches : r.value.isDark = e === "dark", k(r.value), T("maz-color-mode", e));
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
r.value &&
|
|
71
|
+
function j() {
|
|
72
|
+
r.value && n(r.value.isDark ? "light" : "dark");
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function Q() {
|
|
74
75
|
let e;
|
|
75
76
|
try {
|
|
76
|
-
if (e =
|
|
77
|
+
if (e = h("mazThemeState", void 0), !e)
|
|
77
78
|
throw new Error("mazThemeState not found");
|
|
78
79
|
} catch {
|
|
79
|
-
const t =
|
|
80
|
+
const t = v();
|
|
80
81
|
t?.appContext?.app?.config?.globalProperties && (e = t.appContext.app.config.globalProperties.$mazThemeState);
|
|
81
82
|
}
|
|
82
|
-
return e && (r.value ?
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
return e && (r.value ? E() && (r.value = {
|
|
84
|
+
...r.value,
|
|
85
|
+
...e
|
|
86
|
+
}) : I(e)), C(() => e?.currentPreset, (t) => {
|
|
87
|
+
r.value && t && (r.value.currentPreset = t);
|
|
88
|
+
}, {
|
|
89
|
+
once: !0
|
|
90
|
+
}), r.value ? {
|
|
91
|
+
presetName: p,
|
|
92
|
+
colorMode: c,
|
|
93
|
+
isDark: d,
|
|
94
|
+
strategy: m,
|
|
95
|
+
updateTheme: U,
|
|
96
|
+
setColorMode: n,
|
|
97
|
+
toggleDarkMode: j,
|
|
98
|
+
mode: f,
|
|
99
|
+
darkModeStrategy: g
|
|
90
100
|
} : (console.error("[@maz-ui/themes] You must install the MazUi or MazUiTheme plugin before using useTheme composable"), {
|
|
91
|
-
|
|
92
|
-
colorMode:
|
|
93
|
-
isDark:
|
|
94
|
-
strategy:
|
|
101
|
+
presetName: p,
|
|
102
|
+
colorMode: c,
|
|
103
|
+
isDark: d,
|
|
104
|
+
strategy: m,
|
|
105
|
+
mode: f,
|
|
106
|
+
darkModeStrategy: g,
|
|
95
107
|
updateTheme: () => Promise.resolve(),
|
|
96
108
|
setColorMode: () => {
|
|
97
109
|
},
|
|
@@ -100,6 +112,6 @@ function G() {
|
|
|
100
112
|
});
|
|
101
113
|
}
|
|
102
114
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
115
|
+
l as initThemeState,
|
|
116
|
+
Q as useTheme
|
|
105
117
|
};
|
package/dist/plugin/index.js
CHANGED
|
@@ -2,7 +2,8 @@ import "vue";
|
|
|
2
2
|
import "../utils/css-generator.js";
|
|
3
3
|
import "../utils/get-color-mode.js";
|
|
4
4
|
import "../utils/get-preset.js";
|
|
5
|
-
import
|
|
5
|
+
import "../utils/preset-merger.js";
|
|
6
|
+
import { MazUiTheme as a } from "../plugin.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
a as MazUiTheme
|
|
8
9
|
};
|
package/dist/plugin.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { generateCriticalCSS as
|
|
3
|
-
import { getColorMode as
|
|
4
|
-
import { getPreset as
|
|
1
|
+
import { reactive as n } from "vue";
|
|
2
|
+
import { generateCriticalCSS as l, injectCSS as d, CSS_IDS as i, generateFullCSS as S } from "./utils/css-generator.js";
|
|
3
|
+
import { getColorMode as u, isSystemPrefersDark as f } from "./utils/get-color-mode.js";
|
|
4
|
+
import { getPreset as y } from "./utils/get-preset.js";
|
|
5
|
+
import { mergePresets as C } from "./utils/preset-merger.js";
|
|
5
6
|
function g(r, t) {
|
|
6
7
|
typeof document > "u" || r !== "class" || (t ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark"));
|
|
7
8
|
}
|
|
@@ -9,34 +10,36 @@ function k(r, t) {
|
|
|
9
10
|
if (typeof document > "u")
|
|
10
11
|
return;
|
|
11
12
|
const e = {
|
|
12
|
-
mode: t.mode
|
|
13
|
+
mode: t.mode,
|
|
14
|
+
darkSelectorStrategy: t.darkModeStrategy
|
|
13
15
|
};
|
|
14
16
|
if (t.injectCriticalCSS) {
|
|
15
|
-
const a =
|
|
16
|
-
i
|
|
17
|
+
const a = l(r, e);
|
|
18
|
+
d(i.CRITICAL, a);
|
|
17
19
|
}
|
|
18
20
|
if (!t.injectFullCSS)
|
|
19
21
|
return;
|
|
20
|
-
const o =
|
|
21
|
-
t.strategy === "runtime" ? i
|
|
22
|
-
i
|
|
22
|
+
const o = S(r, e);
|
|
23
|
+
t.strategy === "runtime" ? d(i.FULL, o) : t.strategy === "hybrid" && requestIdleCallback(() => {
|
|
24
|
+
d(i.FULL, o);
|
|
23
25
|
}, { timeout: 100 });
|
|
24
26
|
}
|
|
25
|
-
function
|
|
27
|
+
function M(r, t) {
|
|
26
28
|
r.provide("mazThemeState", t), r.config.globalProperties.$mazThemeState = t;
|
|
27
29
|
}
|
|
28
|
-
const
|
|
30
|
+
const v = {
|
|
29
31
|
async install(r, t = {}) {
|
|
30
32
|
const e = {
|
|
31
33
|
preset: "maz-ui",
|
|
32
34
|
strategy: "runtime",
|
|
35
|
+
overrides: {},
|
|
33
36
|
darkModeStrategy: "class",
|
|
34
|
-
colorMode: t.mode !== "both" ? t.mode : t.colorMode,
|
|
37
|
+
colorMode: (t.mode !== "both" ? t.mode : t.colorMode) ?? "auto",
|
|
35
38
|
injectCriticalCSS: !0,
|
|
36
39
|
injectFullCSS: !0,
|
|
37
40
|
mode: "both",
|
|
38
41
|
...t
|
|
39
|
-
}, o = e.mode !== "both" ? e.mode :
|
|
42
|
+
}, o = e.mode !== "both" ? e.mode : u(e.colorMode), a = o === "auto" && e.mode === "both" ? f() : o === "dark" || e.mode === "dark", s = n({
|
|
40
43
|
// @ts-expect-error - empty currentPreset to avoid error
|
|
41
44
|
currentPreset: {},
|
|
42
45
|
mode: e.mode,
|
|
@@ -45,21 +48,11 @@ const j = {
|
|
|
45
48
|
strategy: e.strategy,
|
|
46
49
|
darkModeStrategy: e.darkModeStrategy
|
|
47
50
|
});
|
|
48
|
-
g(e.darkModeStrategy, a),
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
foundation: {
|
|
52
|
-
...d.foundation,
|
|
53
|
-
...e.overrides.foundation
|
|
54
|
-
},
|
|
55
|
-
colors: {
|
|
56
|
-
light: { ...d.colors.light, ...e.overrides.colors?.light },
|
|
57
|
-
dark: { ...d.colors.dark, ...e.overrides.colors?.dark }
|
|
58
|
-
}
|
|
59
|
-
} : d;
|
|
60
|
-
n.currentPreset = c, e.strategy !== "buildtime" && k(c, e);
|
|
51
|
+
g(e.darkModeStrategy, a), M(r, s);
|
|
52
|
+
const c = await y(e.preset), m = Object.keys(e.overrides).length > 0 ? C(c, e.overrides) : c;
|
|
53
|
+
s.currentPreset = m, e.strategy !== "buildtime" && k(m, e);
|
|
61
54
|
}
|
|
62
55
|
};
|
|
63
56
|
export {
|
|
64
|
-
|
|
57
|
+
v as MazUiTheme
|
|
65
58
|
};
|
package/dist/presets/pristine.js
CHANGED
|
@@ -12,8 +12,8 @@ const r = {
|
|
|
12
12
|
foreground: "0 0% 10%",
|
|
13
13
|
primary: "220 10% 15%",
|
|
14
14
|
"primary-foreground": "0 0% 100%",
|
|
15
|
-
contrast: "
|
|
16
|
-
"contrast-foreground": "0 0%
|
|
15
|
+
contrast: "0 0% 15%",
|
|
16
|
+
"contrast-foreground": "0 0% 95%",
|
|
17
17
|
secondary: "220 10% 92%",
|
|
18
18
|
"secondary-foreground": "0 0% 10%",
|
|
19
19
|
muted: "0 0% 60%",
|
|
@@ -36,8 +36,8 @@ const r = {
|
|
|
36
36
|
foreground: "0 0% 95%",
|
|
37
37
|
primary: "0 0% 95%",
|
|
38
38
|
"primary-foreground": "0 0% 10%",
|
|
39
|
-
contrast: "
|
|
40
|
-
"contrast-foreground": "0 0%
|
|
39
|
+
contrast: "220 10% 92%",
|
|
40
|
+
"contrast-foreground": "0 0% 10%",
|
|
41
41
|
secondary: "0 0% 18%",
|
|
42
42
|
"secondary-foreground": "0 0% 95%",
|
|
43
43
|
muted: "0 0% 60%",
|
|
@@ -1,137 +1,15 @@
|
|
|
1
|
-
import { ColorMode, Strategy, ThemePreset, ThemePresetName, ThemePresetOverrides, ThemeState } from '../types';
|
|
1
|
+
import { ColorMode, DarkModeStrategy, Strategy, ThemeMode, ThemePreset, ThemePresetName, ThemePresetOverrides, ThemeState } from '../types';
|
|
2
2
|
export declare function initThemeState(initialState: ThemeState): void;
|
|
3
3
|
declare function updateTheme(preset: ThemePreset | ThemePresetOverrides | ThemePresetName): Promise<void>;
|
|
4
4
|
declare function setColorMode(colorMode: ColorMode): void;
|
|
5
5
|
declare function toggleDarkMode(): void;
|
|
6
6
|
export declare function useTheme(): {
|
|
7
|
-
|
|
8
|
-
name: string;
|
|
9
|
-
colors: {
|
|
10
|
-
light: {
|
|
11
|
-
background: import('..').HSL;
|
|
12
|
-
foreground: import('..').HSL;
|
|
13
|
-
primary: import('..').HSL;
|
|
14
|
-
'primary-foreground': import('..').HSL;
|
|
15
|
-
secondary: import('..').HSL;
|
|
16
|
-
'secondary-foreground': import('..').HSL;
|
|
17
|
-
accent: import('..').HSL;
|
|
18
|
-
'accent-foreground': import('..').HSL;
|
|
19
|
-
info: import('..').HSL;
|
|
20
|
-
'info-foreground': import('..').HSL;
|
|
21
|
-
contrast: import('..').HSL;
|
|
22
|
-
'contrast-foreground': import('..').HSL;
|
|
23
|
-
destructive: import('..').HSL;
|
|
24
|
-
'destructive-foreground': import('..').HSL;
|
|
25
|
-
success: import('..').HSL;
|
|
26
|
-
'success-foreground': import('..').HSL;
|
|
27
|
-
warning: import('..').HSL;
|
|
28
|
-
'warning-foreground': import('..').HSL;
|
|
29
|
-
overlay: import('..').HSL;
|
|
30
|
-
muted: import('..').HSL;
|
|
31
|
-
border: import('..').HSL;
|
|
32
|
-
shadow: import('..').HSL;
|
|
33
|
-
};
|
|
34
|
-
dark: {
|
|
35
|
-
background: import('..').HSL;
|
|
36
|
-
foreground: import('..').HSL;
|
|
37
|
-
primary: import('..').HSL;
|
|
38
|
-
'primary-foreground': import('..').HSL;
|
|
39
|
-
secondary: import('..').HSL;
|
|
40
|
-
'secondary-foreground': import('..').HSL;
|
|
41
|
-
accent: import('..').HSL;
|
|
42
|
-
'accent-foreground': import('..').HSL;
|
|
43
|
-
info: import('..').HSL;
|
|
44
|
-
'info-foreground': import('..').HSL;
|
|
45
|
-
contrast: import('..').HSL;
|
|
46
|
-
'contrast-foreground': import('..').HSL;
|
|
47
|
-
destructive: import('..').HSL;
|
|
48
|
-
'destructive-foreground': import('..').HSL;
|
|
49
|
-
success: import('..').HSL;
|
|
50
|
-
'success-foreground': import('..').HSL;
|
|
51
|
-
warning: import('..').HSL;
|
|
52
|
-
'warning-foreground': import('..').HSL;
|
|
53
|
-
overlay: import('..').HSL;
|
|
54
|
-
muted: import('..').HSL;
|
|
55
|
-
border: import('..').HSL;
|
|
56
|
-
shadow: import('..').HSL;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
foundation: {
|
|
60
|
-
'base-font-size'?: import('..').SizeUnit | undefined;
|
|
61
|
-
radius: import('..').SizeUnit;
|
|
62
|
-
'border-width': import('..').SizeUnit;
|
|
63
|
-
'font-family'?: string | undefined;
|
|
64
|
-
};
|
|
65
|
-
}, ThemePreset | {
|
|
66
|
-
name: string;
|
|
67
|
-
colors: {
|
|
68
|
-
light: {
|
|
69
|
-
background: import('..').HSL;
|
|
70
|
-
foreground: import('..').HSL;
|
|
71
|
-
primary: import('..').HSL;
|
|
72
|
-
'primary-foreground': import('..').HSL;
|
|
73
|
-
secondary: import('..').HSL;
|
|
74
|
-
'secondary-foreground': import('..').HSL;
|
|
75
|
-
accent: import('..').HSL;
|
|
76
|
-
'accent-foreground': import('..').HSL;
|
|
77
|
-
info: import('..').HSL;
|
|
78
|
-
'info-foreground': import('..').HSL;
|
|
79
|
-
contrast: import('..').HSL;
|
|
80
|
-
'contrast-foreground': import('..').HSL;
|
|
81
|
-
destructive: import('..').HSL;
|
|
82
|
-
'destructive-foreground': import('..').HSL;
|
|
83
|
-
success: import('..').HSL;
|
|
84
|
-
'success-foreground': import('..').HSL;
|
|
85
|
-
warning: import('..').HSL;
|
|
86
|
-
'warning-foreground': import('..').HSL;
|
|
87
|
-
overlay: import('..').HSL;
|
|
88
|
-
muted: import('..').HSL;
|
|
89
|
-
border: import('..').HSL;
|
|
90
|
-
shadow: import('..').HSL;
|
|
91
|
-
};
|
|
92
|
-
dark: {
|
|
93
|
-
background: import('..').HSL;
|
|
94
|
-
foreground: import('..').HSL;
|
|
95
|
-
primary: import('..').HSL;
|
|
96
|
-
'primary-foreground': import('..').HSL;
|
|
97
|
-
secondary: import('..').HSL;
|
|
98
|
-
'secondary-foreground': import('..').HSL;
|
|
99
|
-
accent: import('..').HSL;
|
|
100
|
-
'accent-foreground': import('..').HSL;
|
|
101
|
-
info: import('..').HSL;
|
|
102
|
-
'info-foreground': import('..').HSL;
|
|
103
|
-
contrast: import('..').HSL;
|
|
104
|
-
'contrast-foreground': import('..').HSL;
|
|
105
|
-
destructive: import('..').HSL;
|
|
106
|
-
'destructive-foreground': import('..').HSL;
|
|
107
|
-
success: import('..').HSL;
|
|
108
|
-
'success-foreground': import('..').HSL;
|
|
109
|
-
warning: import('..').HSL;
|
|
110
|
-
'warning-foreground': import('..').HSL;
|
|
111
|
-
overlay: import('..').HSL;
|
|
112
|
-
muted: import('..').HSL;
|
|
113
|
-
border: import('..').HSL;
|
|
114
|
-
shadow: import('..').HSL;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
foundation: {
|
|
118
|
-
'base-font-size'?: import('..').SizeUnit | undefined;
|
|
119
|
-
radius: import('..').SizeUnit;
|
|
120
|
-
'border-width': import('..').SizeUnit;
|
|
121
|
-
'font-family'?: string | undefined;
|
|
122
|
-
};
|
|
123
|
-
}>;
|
|
124
|
-
colorMode: import('vue').Ref<ColorMode, ColorMode>;
|
|
125
|
-
isDark: import('vue').ComputedRef<boolean>;
|
|
126
|
-
strategy: import('vue').ComputedRef<Strategy>;
|
|
127
|
-
updateTheme: typeof updateTheme;
|
|
128
|
-
setColorMode: typeof setColorMode;
|
|
129
|
-
toggleDarkMode: typeof toggleDarkMode;
|
|
130
|
-
} | {
|
|
131
|
-
currentPreset: import('vue').ComputedRef<ThemePreset>;
|
|
7
|
+
presetName: import('vue').ComputedRef<string>;
|
|
132
8
|
colorMode: import('vue').WritableComputedRef<ColorMode, ColorMode>;
|
|
133
9
|
isDark: import('vue').ComputedRef<boolean>;
|
|
134
10
|
strategy: import('vue').ComputedRef<Strategy>;
|
|
11
|
+
mode: import('vue').ComputedRef<ThemeMode>;
|
|
12
|
+
darkModeStrategy: import('vue').ComputedRef<DarkModeStrategy>;
|
|
135
13
|
updateTheme: typeof updateTheme;
|
|
136
14
|
setColorMode: typeof setColorMode;
|
|
137
15
|
toggleDarkMode: typeof toggleDarkMode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/composables/useTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/composables/useTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AA4DhJ,wBAAgB,cAAc,CAAC,YAAY,EAAE,UAAU,QAsBtD;AAaD,iBAAe,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,oBAAoB,GAAG,eAAe,iBAyBtF;AAED,iBAAS,YAAY,CAAC,SAAS,EAAE,SAAS,QAgBzC;AAED,iBAAS,cAAc,SAKtB;AAED,wBAAgB,QAAQ;;;;;;;iBA+CwB,OAAO,WAAW;kBAChC,OAAO,YAAY;oBACjB,OAAO,cAAc;EAexD"}
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface MazUiThemeOptions extends Omit<ThemeConfig, 'prefix'> {
|
|
|
31
31
|
export declare const MazUiTheme: {
|
|
32
32
|
install(app: App, options?: MazUiThemeOptions): Promise<void>;
|
|
33
33
|
};
|
|
34
|
-
declare module '
|
|
34
|
+
declare module 'vue' {
|
|
35
35
|
interface ComponentCustomProperties {
|
|
36
36
|
/**
|
|
37
37
|
* Maz theme plugin options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,KAAK,EAAoB,WAAW,EAAe,UAAU,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,KAAK,EAAoB,WAAW,EAAe,UAAU,EAAE,MAAM,SAAS,CAAA;AAarF,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC;IACpE;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAE3B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAiDD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU;iBACF,GAAG,YAAW,iBAAiB;CA+CnD,CAAA;AAED,OAAO,QAAQ,KAAK,CAAC;IACnB,UAAU,yBAAyB;QACjC;;;;;;;;;;;;;;WAcG;QACH,cAAc,EAAE,UAAU,CAAA;KAC3B;CACF"}
|
|
@@ -5,9 +5,9 @@ export interface CriticalCSSOptions {
|
|
|
5
5
|
/** Critical foundation variables to include */
|
|
6
6
|
criticalFoundation?: (keyof ThemeFoundation)[];
|
|
7
7
|
/** Theme mode to generate */
|
|
8
|
-
mode
|
|
8
|
+
mode: ThemeMode;
|
|
9
9
|
/** Dark mode selector: 'class' (.dark) | 'media' (@media) */
|
|
10
|
-
darkSelectorStrategy
|
|
10
|
+
darkSelectorStrategy: DarkModeStrategy;
|
|
11
11
|
/** CSS variables prefix */
|
|
12
12
|
prefix?: string;
|
|
13
13
|
}
|
|
@@ -15,9 +15,9 @@ export interface FullCSSOptions {
|
|
|
15
15
|
/** Critical variables to exclude (to avoid duplication) */
|
|
16
16
|
excludeCritical?: (keyof ThemeColors | keyof ThemeFoundation)[];
|
|
17
17
|
/** Theme mode to generate */
|
|
18
|
-
mode
|
|
18
|
+
mode: ThemeMode;
|
|
19
19
|
/** Dark mode selector: 'class' (.dark) | 'media' (@media) */
|
|
20
|
-
darkSelectorStrategy
|
|
20
|
+
darkSelectorStrategy: DarkModeStrategy;
|
|
21
21
|
/** CSS variables prefix */
|
|
22
22
|
prefix?: string;
|
|
23
23
|
/** Include color scales (50-900) */
|
|
@@ -40,7 +40,7 @@ export declare enum CSS_IDS {
|
|
|
40
40
|
/**
|
|
41
41
|
* Injects CSS into the DOM
|
|
42
42
|
*/
|
|
43
|
-
export declare function injectCSS(
|
|
43
|
+
export declare function injectCSS(id: CSS_IDS, css: string): void;
|
|
44
44
|
/**
|
|
45
45
|
* Supprime le CSS du DOM
|
|
46
46
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-generator.d.ts","sourceRoot":"","sources":["../../../src/utils/css-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAOtG,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,cAAc,CAAC,EAAE,CAAC,MAAM,WAAW,CAAC,EAAE,CAAA;IACtC,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,CAAC,MAAM,eAAe,CAAC,EAAE,CAAA;IAC9C,6BAA6B;IAC7B,IAAI,
|
|
1
|
+
{"version":3,"file":"css-generator.d.ts","sourceRoot":"","sources":["../../../src/utils/css-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAOtG,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,cAAc,CAAC,EAAE,CAAC,MAAM,WAAW,CAAC,EAAE,CAAA;IACtC,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,CAAC,MAAM,eAAe,CAAC,EAAE,CAAA;IAC9C,6BAA6B;IAC7B,IAAI,EAAE,SAAS,CAAA;IACf,6DAA6D;IAC7D,oBAAoB,EAAE,gBAAgB,CAAA;IACtC,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,eAAe,CAAC,EAAE,CAAC,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,EAAE,CAAA;IAC/D,6BAA6B;IAC7B,IAAI,EAAE,SAAS,CAAA;IACf,6DAA6D;IAC7D,oBAAoB,EAAE,gBAAgB,CAAA;IACtC,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAoCD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,kBAGR,GACA,MAAM,CAwCR;AAMD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,cAGR,GACA,MAAM,CA4CR;AA+ID,oBAAY,OAAO;IACjB,IAAI,mBAAmB;IACvB,QAAQ,uBAAuB;CAChC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAaxD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAQ3C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ColorMode } from '../types';
|
|
2
2
|
export declare function getColorMode(colorMode?: ColorMode): ColorMode;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function isSystemPrefersDark(): boolean;
|
|
4
4
|
//# sourceMappingURL=get-color-mode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-color-mode.d.ts","sourceRoot":"","sources":["../../../src/utils/get-color-mode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC,wBAAgB,YAAY,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAW7D;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"get-color-mode.d.ts","sourceRoot":"","sources":["../../../src/utils/get-color-mode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC,wBAAgB,YAAY,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAW7D;AAED,wBAAgB,mBAAmB,YAElC"}
|
|
@@ -26,67 +26,89 @@ const h = [
|
|
|
26
26
|
"font-family",
|
|
27
27
|
"base-font-size",
|
|
28
28
|
"border-width"
|
|
29
|
-
],
|
|
30
|
-
function j(e, o = {
|
|
29
|
+
], S = ["primary", "secondary", "accent", "destructive", "success", "warning", "info", "contrast", "background", "foreground", "border", "muted", "overlay", "shadow"];
|
|
30
|
+
function j(e, o = {
|
|
31
|
+
mode: "both",
|
|
32
|
+
darkSelectorStrategy: "class"
|
|
33
|
+
}) {
|
|
31
34
|
const {
|
|
32
35
|
criticalColors: r = h,
|
|
33
36
|
criticalFoundation: c = C,
|
|
34
|
-
mode:
|
|
35
|
-
darkSelectorStrategy:
|
|
37
|
+
mode: t,
|
|
38
|
+
darkSelectorStrategy: s,
|
|
36
39
|
prefix: i = "maz"
|
|
37
|
-
} = o,
|
|
38
|
-
let
|
|
40
|
+
} = o, l = y(e.foundation, c);
|
|
41
|
+
let n = `@layer maz-ui-theme {
|
|
39
42
|
`;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
if (t === "light" || t === "both") {
|
|
44
|
+
const a = m(e.colors.light, r);
|
|
45
|
+
n += f({
|
|
46
|
+
selector: ":root",
|
|
47
|
+
colors: a,
|
|
48
|
+
foundation: l,
|
|
49
|
+
prefix: i
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (t === "dark" || t === "both") {
|
|
53
|
+
const a = m(e.colors.dark, r);
|
|
54
|
+
n += f({
|
|
55
|
+
selector: s === "media" ? ":root" : ".dark",
|
|
56
|
+
mediaQuery: s === "media" ? "@media (prefers-color-scheme: dark)" : void 0,
|
|
57
|
+
colors: a,
|
|
58
|
+
foundation: l,
|
|
59
|
+
prefix: i
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return n += `}
|
|
63
|
+
`, n;
|
|
53
64
|
}
|
|
54
|
-
function p(e, o = {
|
|
65
|
+
function p(e, o = {
|
|
66
|
+
mode: "both",
|
|
67
|
+
darkSelectorStrategy: "class"
|
|
68
|
+
}) {
|
|
55
69
|
const {
|
|
56
70
|
excludeCritical: r = h,
|
|
57
|
-
mode: c
|
|
58
|
-
darkSelectorStrategy:
|
|
59
|
-
prefix:
|
|
71
|
+
mode: c,
|
|
72
|
+
darkSelectorStrategy: t,
|
|
73
|
+
prefix: s = "maz",
|
|
60
74
|
includeColorScales: i = !0
|
|
61
|
-
} = o,
|
|
62
|
-
let
|
|
75
|
+
} = o, l = k(e.foundation, C);
|
|
76
|
+
let n = `@layer maz-ui-theme {
|
|
63
77
|
`;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
if (c === "light" || c === "both") {
|
|
79
|
+
const a = g(e.colors.light, r);
|
|
80
|
+
n += f({
|
|
81
|
+
selector: ":root",
|
|
82
|
+
colors: a,
|
|
83
|
+
foundation: l,
|
|
84
|
+
prefix: s,
|
|
85
|
+
includeScales: i,
|
|
86
|
+
preset: e
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (c === "dark" || c === "both") {
|
|
90
|
+
const a = g(e.colors.dark, r);
|
|
91
|
+
n += f({
|
|
92
|
+
selector: t === "media" ? ":root" : ".dark",
|
|
93
|
+
mediaQuery: t === "media" ? "@media (prefers-color-scheme: dark)" : void 0,
|
|
94
|
+
colors: a,
|
|
95
|
+
foundation: c === "dark" ? l : void 0,
|
|
96
|
+
// Appearance only if dark mode only
|
|
97
|
+
prefix: s,
|
|
98
|
+
includeScales: i,
|
|
99
|
+
preset: e,
|
|
100
|
+
isDark: !0
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return n += `}
|
|
104
|
+
`, n;
|
|
83
105
|
}
|
|
84
106
|
function m(e, o) {
|
|
85
107
|
return Object.fromEntries(
|
|
86
108
|
o.filter((r) => e[r]).map((r) => [r, e[r]])
|
|
87
109
|
);
|
|
88
110
|
}
|
|
89
|
-
function
|
|
111
|
+
function y(e, o) {
|
|
90
112
|
return e ? Object.fromEntries(
|
|
91
113
|
o.filter((r) => e[r]).map((r) => [r, e[r]])
|
|
92
114
|
) : {};
|
|
@@ -106,42 +128,42 @@ function f({
|
|
|
106
128
|
mediaQuery: o,
|
|
107
129
|
colors: r,
|
|
108
130
|
foundation: c,
|
|
109
|
-
prefix:
|
|
110
|
-
includeScales:
|
|
131
|
+
prefix: t,
|
|
132
|
+
includeScales: s = !1,
|
|
111
133
|
preset: i,
|
|
112
|
-
isDark:
|
|
134
|
+
isDark: l = !1
|
|
113
135
|
}) {
|
|
114
|
-
const
|
|
115
|
-
if (r && Object.entries(r).forEach(([
|
|
116
|
-
|
|
117
|
-
}), c && Object.entries(c).forEach(([
|
|
118
|
-
|
|
119
|
-
}),
|
|
120
|
-
const
|
|
121
|
-
|
|
136
|
+
const n = [];
|
|
137
|
+
if (r && Object.entries(r).forEach(([u, d]) => {
|
|
138
|
+
d && n.push(` --${t}-${u}: ${d};`);
|
|
139
|
+
}), c && Object.entries(c).forEach(([u, d]) => {
|
|
140
|
+
d && n.push(` --${t}-${u}: ${d};`);
|
|
141
|
+
}), s && i) {
|
|
142
|
+
const u = l ? i.colors.dark : i.colors.light, d = E(u, t);
|
|
143
|
+
n.push(...d);
|
|
122
144
|
}
|
|
123
|
-
const
|
|
145
|
+
const a = n.join(`
|
|
124
146
|
`);
|
|
125
147
|
return o ? `
|
|
126
148
|
${o} {
|
|
127
149
|
${e} {
|
|
128
|
-
${
|
|
150
|
+
${a.replace(/^/gm, " ")}
|
|
129
151
|
}
|
|
130
152
|
}
|
|
131
153
|
` : `
|
|
132
154
|
${e} {
|
|
133
|
-
${
|
|
155
|
+
${a}
|
|
134
156
|
}
|
|
135
157
|
`;
|
|
136
158
|
}
|
|
137
159
|
function E(e, o) {
|
|
138
160
|
const r = [];
|
|
139
|
-
return
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
142
|
-
const
|
|
143
|
-
Object.entries(
|
|
144
|
-
r.push(` --${o}-${c}-${i}: ${
|
|
161
|
+
return S.forEach((c) => {
|
|
162
|
+
const t = e[c];
|
|
163
|
+
if (t) {
|
|
164
|
+
const s = b(t);
|
|
165
|
+
Object.entries(s).forEach(([i, l]) => {
|
|
166
|
+
r.push(` --${o}-${c}-${i}: ${l};`);
|
|
145
167
|
});
|
|
146
168
|
}
|
|
147
169
|
}), r;
|
|
@@ -150,8 +172,8 @@ var $ = /* @__PURE__ */ ((e) => (e.FULL = "maz-theme-full", e.CRITICAL = "maz-th
|
|
|
150
172
|
function v(e, o) {
|
|
151
173
|
if (typeof document > "u")
|
|
152
174
|
return;
|
|
153
|
-
let r = document.getElementById(
|
|
154
|
-
r || (r = document.createElement("style"), r.id =
|
|
175
|
+
let r = document.getElementById(e);
|
|
176
|
+
r || (r = document.createElement("style"), r.id = e, document.head.appendChild(r)), r.textContent = o;
|
|
155
177
|
}
|
|
156
178
|
function F(e) {
|
|
157
179
|
if (typeof document > "u")
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { getCookie as
|
|
2
|
-
function
|
|
1
|
+
import { getCookie as r } from "./cookie-storage.js";
|
|
2
|
+
function o(e) {
|
|
3
3
|
if (e && ["light", "dark"].includes(e))
|
|
4
4
|
return e;
|
|
5
|
-
const
|
|
6
|
-
return
|
|
5
|
+
const t = r("maz-color-mode");
|
|
6
|
+
return t && ["light", "dark"].includes(t) ? t : "auto";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return typeof globalThis.window < "u" && typeof globalThis.matchMedia == "function" && globalThis.matchMedia("(prefers-color-scheme: dark)").matches
|
|
8
|
+
function n() {
|
|
9
|
+
return typeof globalThis.window < "u" && typeof globalThis.matchMedia == "function" && globalThis.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
10
10
|
}
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
o as getColorMode,
|
|
13
|
+
n as isSystemPrefersDark
|
|
14
14
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maz-ui/themes",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.24",
|
|
5
5
|
"description": "Theme system for Maz-UI with TypeScript support and CSS variables",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"lint-staged": {
|
|
101
101
|
"*.{js,ts,vue,mjs,mts,cjs,md,yml,json}": "cross-env NODE_ENV=production eslint --fix"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "9ea5ccdfb15f18c4e102ef5d2cfba29bd304d38e"
|
|
104
104
|
}
|