From 1052ea8a45b079b20a9d8ef887d7d74393d9ea13 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 14 Sep 2020 13:52:22 +0100 Subject: [PATCH] Add italic font --- epicyon-profile.css | 7 +++++++ theme.py | 13 ++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/epicyon-profile.css b/epicyon-profile.css index af681cf9..bbf4af22 100644 --- a/epicyon-profile.css +++ b/epicyon-profile.css @@ -59,6 +59,13 @@ --focus-color: white; } +@font-face { + font-family: 'Bedstead'; + font-style: italic; + font-weight: normal; + font-display: block; + src: url('./fonts/bedstead.otf') format('opentype'); +} @font-face { font-family: 'Bedstead'; font-style: normal; diff --git a/theme.py b/theme.py index 6a7bd537..4c157c1b 100644 --- a/theme.py +++ b/theme.py @@ -68,7 +68,10 @@ def setCSSparam(css: str, param: str, value: str) -> str: return css.replace(param, value) # if the parameter begins with * then don't prepend -- if param.startswith('*'): - searchStr = param.replace('*', '') + ':' + if param.startswith('**'): + searchStr = param.replace('**', '', 1) + ':' + else: + searchStr = param.replace('*', '') + ':' else: searchStr = '--' + param + ':' if searchStr not in css: @@ -276,6 +279,8 @@ def setThemeNight(baseDir: str): setThemeInConfig(baseDir, name) fontStr = \ "url('./fonts/solidaric.woff2') format('woff2')" + fontStrItalic = \ + "url('./fonts/solidaric-italic.woff2') format('woff2')" themeParams = { "focus-color": "blue", "font-size-button-mobile": "36px", @@ -306,7 +311,8 @@ def setThemeNight(baseDir: str): "event-color": "#7961ab", "event-background": "#333", "*font-family": "'solidaric'", - "*src": fontStr + "*src": fontStr, + "**src": fontStrItalic } bgParams = { "login": "jpg", @@ -767,7 +773,8 @@ def setThemeSolidaric(baseDir: str): "title-background": "#ccc", "gallery-text-color": "black", "*font-family": "'solidaric'", - "*src": "url('./fonts/solidaric.woff2') format('woff2')" + "*src": "url('./fonts/solidaric.woff2') format('woff2')", + "**src": "url('./fonts/solidaric-italic.woff2') format('woff2')" } bgParams = { "login": "jpg",