From 60212ceb069a5a54636942b8429233973db1ae25 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 16 Nov 2020 20:13:48 +0000 Subject: [PATCH] Handle font family which is a variable --- theme.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/theme.py b/theme.py index 6fd7480d..20e3b1ef 100644 --- a/theme.py +++ b/theme.py @@ -160,6 +160,14 @@ def setCSSparam(css: str, param: str, value: str) -> str: s = css.split(searchStr) newcss = '' for sectionStr in s: + # handle font-family which is a variable + nextSection = sectionStr + if ';' in nextSection: + nextSection = nextSection.split(';')[0] + ';' + if searchStr == 'font-family:' and "var(--" in nextSection: + newcss += searchStr + ' ' + sectionStr + continue + if not newcss: if sectionStr: newcss = sectionStr