fix(themamanager): Fixed automatic global theme change subscription for background updates.

This commit is contained in:
Philipp Kunz 2025-01-09 00:33:46 +01:00
parent 916fd48858
commit 25a813d35f
3 changed files with 11 additions and 2 deletions

View File

@ -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.

View File

@ -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.'
} }

View File

@ -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';
}
});
} }
} }