@ziadshalaby/ngx-zs-component 3.0.1 → 3.0.2
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.
|
@@ -1946,8 +1946,11 @@ class ThemeToggle {
|
|
|
1946
1946
|
effect(() => {
|
|
1947
1947
|
const theme = this.currentTheme();
|
|
1948
1948
|
document.documentElement.classList.toggle('dark', theme === 'dark');
|
|
1949
|
-
const classes = this.bodyClass()
|
|
1950
|
-
|
|
1949
|
+
const classes = this.bodyClass()
|
|
1950
|
+
.trim()
|
|
1951
|
+
.split(/\s+/)
|
|
1952
|
+
.filter(Boolean);
|
|
1953
|
+
document.body.classList.value = '';
|
|
1951
1954
|
classes.forEach(c => document.body.classList.add(c));
|
|
1952
1955
|
if (this.userSelectedTheme()) {
|
|
1953
1956
|
localStorage.setItem('theme', theme);
|