From e083856801179eef1c6efb6452ea50b46d3d8f7e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 23 Jun 2020 17:53:16 +0200 Subject: [PATCH] allow changing the font-family --- res/themes/light-custom/css/_custom.scss | 2 ++ src/theme.js | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/res/themes/light-custom/css/_custom.scss b/res/themes/light-custom/css/_custom.scss index 6206496150..e7912e3cb0 100644 --- a/res/themes/light-custom/css/_custom.scss +++ b/res/themes/light-custom/css/_custom.scss @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +$font-family: var(--font-family, $font-family); +$monospace-font-family: var(--font-family-monospace, $monospace-font-family); // // --accent-color $accent-color: var(--accent-color); diff --git a/src/theme.js b/src/theme.js index 095990de3a..da70dc7bb1 100644 --- a/src/theme.js +++ b/src/theme.js @@ -60,6 +60,15 @@ function setCustomThemeVars(customTheme) { } } } + if (customTheme.fonts) { + const {fonts} = customTheme; + if (fonts.general) { + style.setProperty("--font-family", fonts.general); + } + if (fonts.monospace) { + style.setProperty("--font-family-monospace", fonts.monospace); + } + } } export function getCustomTheme(themeName) {