From 2cee54a0216d1dcb958ada372e74ad36f7a6a80a Mon Sep 17 00:00:00 2001 From: Grace Kind Date: Sun, 26 Jul 2026 17:53:47 -0500 Subject: [PATCH] Fix theme-color set --- package.json | 2 +- src/js/theme.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2c77b741..f1b25e81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "impro", - "version": "0.18.85", + "version": "0.18.86", "type": "module", "scripts": { "start": "rm -rf \"${BUILD_DIR:-build}\" && NODE_ENV=development eleventy --serve", diff --git a/src/js/theme.js b/src/js/theme.js index 0a8e0578..154385fd 100644 --- a/src/js/theme.js +++ b/src/js/theme.js @@ -5,6 +5,16 @@ function getRootStyle() { return getComputedStyle(document.documentElement); } +function resolveCssColor(value) { + const probe = document.createElement("div"); + probe.style.color = value; + probe.style.display = "none"; + document.documentElement.appendChild(probe); + const resolved = getComputedStyle(probe).color; + probe.remove(); + return resolved; +} + export function getDefaultHighlightColor() { return getRootStyle().getPropertyValue("--blue"); } @@ -25,7 +35,7 @@ export class Theme { } getBackgroundColor() { - return getRootStyle().getPropertyValue("--background-color"); + return resolveCssColor("var(--background-color)"); } updateHighlightColor(highlightColor) { -- 2.51.2