fix(themamanager): Fixed automatic global theme change subscription for background updates.
This commit is contained in:
parent
916fd48858
commit
25a813d35f
@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-01-09 - 2.1.1 - fix(themamanager)
|
||||||
|
Fixed automatic global theme change subscription for background updates.
|
||||||
|
|
||||||
|
- Corrected the logic for updating the document's background color upon theme changes using themeObservable subscription.
|
||||||
|
|
||||||
## 2025-01-09 - 2.1.0 - feat(themeManager)
|
## 2025-01-09 - 2.1.0 - feat(themeManager)
|
||||||
Exposed method to enable automatic global theme change.
|
Exposed method to enable automatic global theme change.
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-domtools',
|
name: '@design.estate/dees-domtools',
|
||||||
version: '2.1.0',
|
version: '2.1.1',
|
||||||
description: 'A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.'
|
description: 'A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.'
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,11 @@ export class ThemeManager {
|
|||||||
|
|
||||||
public async enableAutomaticGlobalThemeChange() {
|
public async enableAutomaticGlobalThemeChange() {
|
||||||
if (document.body && document.body.style) {
|
if (document.body && document.body.style) {
|
||||||
document.body.style.background = this.goBrightBoolean ? '#fff' : '#000';
|
this.themeObservable.subscribe({
|
||||||
|
next: (goBright) => {
|
||||||
|
document.body.style.background = goBright ? '#fff' : '#000';
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user