From 7727c910bd40a95549aa0e555312c00054388927 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 14 Nov 2020 13:18:11 +0000 Subject: [PATCH] Can use custom css per theme --- theme.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/theme.py b/theme.py index 044c19b46..ee0f4ea12 100644 --- a/theme.py +++ b/theme.py @@ -175,11 +175,21 @@ def setThemeFromDict(baseDir: str, name: str, setThemeInConfig(baseDir, name) themeFiles = getThemeFiles() for filename in themeFiles: - templateFilename = baseDir + '/epicyon-' + filename + # check for custom css within the theme directory + templateFilename = baseDir + '/theme/' + name + '/epicyon-' + filename if filename == 'epicyon.css': - templateFilename = baseDir + '/epicyon-profile.css' + templateFilename = \ + baseDir + '/theme/' + name + '/epicyon-profile.css' + + if not os.path.isfile(templateFilename): + # use default css + templateFilename = baseDir + '/epicyon-' + filename + if filename == 'epicyon.css': + templateFilename = baseDir + '/epicyon-profile.css' + if not os.path.isfile(templateFilename): continue + with open(templateFilename, 'r') as cssfile: css = cssfile.read() for paramName, paramValue in themeParams.items():