diff --git a/webapp_themeDesigner.py b/webapp_themeDesigner.py
index b2be20a9e..e443e1af4 100644
--- a/webapp_themeDesigner.py
+++ b/webapp_themeDesigner.py
@@ -243,7 +243,7 @@ def htmlThemeDesigner(cssCache: {}, baseDir: str,
'
| \n'
- elif (variableName.endswith('-color') or
+ elif ('-color' in variableName or
variableName.endswith('-text')):
# only use colors defined as hex
if not value.startswith('#'):
@@ -252,11 +252,11 @@ def htmlThemeDesigner(cssCache: {}, baseDir: str,
else:
continue
variableNameStr = variableName.replace('-', ' ')
- if variableNameStr.endswith(' color'):
+ if ' color' in variableNameStr:
variableNameStr = variableNameStr.replace(' color', '')
- if variableNameStr.endswith(' bg'):
+ if ' bg' in variableNameStr:
variableNameStr = variableNameStr.replace(' bg', ' background')
- elif variableNameStr.endswith(' fg'):
+ elif ' fg' in variableNameStr:
variableNameStr = variableNameStr.replace(' fg', ' foreground')
if variableNameStr == 'cw':
variableNameStr = 'content warning'