@dnax/ui 0.0.26 → 0.0.27
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.
|
@@ -86,6 +86,11 @@ onMounted(() => {
|
|
|
86
86
|
})
|
|
87
87
|
onBeforeUnmount(() => {
|
|
88
88
|
mql?.removeEventListener("change", updateSystem)
|
|
89
|
+
// Retire les variables de thème posées sur <html> (provider racine)
|
|
90
|
+
if (isProvidersRoot.value && typeof document !== "undefined") {
|
|
91
|
+
for (const key of appliedThemeKeys) document.documentElement.style.removeProperty(key)
|
|
92
|
+
appliedThemeKeys = []
|
|
93
|
+
}
|
|
89
94
|
})
|
|
90
95
|
|
|
91
96
|
/** Mode effectif : light | dark | system résolu */
|
|
@@ -144,6 +149,26 @@ const themeStyle = computed<Record<string, string>>(() => {
|
|
|
144
149
|
if (isRadiusScale(global)) style["--q-radius"] = RADIUS_VALUES[global]
|
|
145
150
|
return style
|
|
146
151
|
})
|
|
152
|
+
|
|
153
|
+
// Thème GLOBAL (provider racine) : pose aussi les variables sur <html> — les
|
|
154
|
+
// overlays téléportés au body (dialogs $q.dialog, …) perdent l'héritage du div
|
|
155
|
+
// .q-config-provider et retomberaient sur :root (couleurs par défaut). Comme la
|
|
156
|
+
// classe .dark déjà posée sur <html>, les téléports héritent du thème réel.
|
|
157
|
+
// Les providers imbriqués (non-root) ne touchent pas <html> : leur div local prime.
|
|
158
|
+
let appliedThemeKeys: string[] = []
|
|
159
|
+
watch(
|
|
160
|
+
[themeStyle, isProvidersRoot],
|
|
161
|
+
([style, root]) => {
|
|
162
|
+
if (typeof document === "undefined" || !root) return
|
|
163
|
+
for (const key of appliedThemeKeys) document.documentElement.style.removeProperty(key)
|
|
164
|
+
appliedThemeKeys = []
|
|
165
|
+
for (const [k, v] of Object.entries(style)) {
|
|
166
|
+
document.documentElement.style.setProperty(k, v)
|
|
167
|
+
appliedThemeKeys.push(k)
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{ immediate: true },
|
|
171
|
+
)
|
|
147
172
|
</script>
|
|
148
173
|
|
|
149
174
|
<template>
|