Can use custom css per theme

main
Bob Mottram 2020-11-14 13:18:11 +00:00
parent 98218f8dbb
commit 7727c910bd
1 changed files with 12 additions and 2 deletions

View File

@ -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():