Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 075c8c3

Browse files
authored
Fix bug on Avatar.ts for custom theme avatar background color (#10598)
1 parent 256c359 commit 075c8c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Avatar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function defaultAvatarUrlForString(s: string): string {
9696
const colorIndex = total % defaultColors.length;
9797
// overwritten color value in custom themes
9898
const cssVariable = `--avatar-background-colors_${colorIndex}`;
99-
const cssValue = document.body.style.getPropertyValue(cssVariable);
99+
const cssValue = getComputedStyle(document.body).getPropertyValue(cssVariable);
100100
const color = cssValue || defaultColors[colorIndex];
101101
let dataUrl = colorToDataURLCache.get(color);
102102
if (!dataUrl) {

0 commit comments

Comments
 (0)