From ec2afce97e4fa769ccf1088ae19b95fb94510930 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 27 Feb 2024 22:02:44 +0200 Subject: [PATCH] improve performance a bit and use better "worst case" color --- src/services/style_setter/style_setter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 74d745f056..1e16d3b5e7 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -15,7 +15,8 @@ export const applyTheme = async (input) => { extraRules = convertTheme2To3(theme) } - const themes3 = init(extraRules, '#FFFFFF') + // Assuming that "worst case scenario background" is panel background since it's the most likely one + const themes3 = init(extraRules, extraRules[0].directives['--bg'].split('|')[1].trim()) const head = document.head const body = document.body body.classList.add('hidden') @@ -54,7 +55,7 @@ export const applyTheme = async (input) => { styleSheet.insertRule(rule, 'index-max') }) }) - }, 50) + }, 200) }) return Promise.resolve()