From 6f8c44b2eb69cbe6938a1ca85f6aa800fdc6ca67 Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 18 Jul 2023 13:26:41 -0400 Subject: [PATCH] Fix category colors sometimes not working --- src/content.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content.ts b/src/content.ts index 3a9893b7..28c87aad 100644 --- a/src/content.ts +++ b/src/content.ts @@ -2489,7 +2489,9 @@ function setCategoryColorCSSVariables() { if (!styleContainer) { styleContainer = document.createElement("style"); styleContainer.id = "sbCategoryColorStyle"; - document.head.appendChild(styleContainer) + + const head = (document.head || document.documentElement); + head.appendChild(styleContainer) } let css = ":root {"