From bcb5f5420260ff4d0fed210fec5084c873966b18 Mon Sep 17 00:00:00 2001 From: Julien DAUPHANT <1238254+jdauphant@users.noreply.github.com> Date: Thu, 13 Apr 2023 23:01:08 +0200 Subject: [PATCH] Fix bug on Avatar.ts for custom theme avatar background color --- src/Avatar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avatar.ts b/src/Avatar.ts index 88c80ef4b14..a023ba0ee75 100644 --- a/src/Avatar.ts +++ b/src/Avatar.ts @@ -96,7 +96,7 @@ export function defaultAvatarUrlForString(s: string): string { const colorIndex = total % defaultColors.length; // overwritten color value in custom themes const cssVariable = `--avatar-background-colors_${colorIndex}`; - const cssValue = document.body.style.getPropertyValue(cssVariable); + const cssValue = getComputedStyle(document.body).getPropertyValue(cssVariable); const color = cssValue || defaultColors[colorIndex]; let dataUrl = colorToDataURLCache.get(color); if (!dataUrl) {