Skip to content

Commit 4c9ab4d

Browse files
committed
fix(theme-service): unify globalThis access with SSR-safe check
1 parent c9eafb1 commit 4c9ab4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

projects/igniteui-angular/src/lib/services/theme/theme.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export class ThemeService {
3838
}
3939

4040
private init() {
41-
const theme = globalThis
42-
.getComputedStyle(this.document.body)
41+
const theme = globalThis.window
42+
?.getComputedStyle(this.document.body)
4343
.getPropertyValue("--ig-theme")
4444
.trim();
4545

0 commit comments

Comments
 (0)