From 5b6d31ce31efc25dafecc5526478d16cc61e096c Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Wed, 1 May 2019 18:10:07 -0400 Subject: [PATCH] frontend: add option to not use Source Sans Pro Closes https://gitlab.com/commento/commento/issues/136 --- frontend/js/commento.js | 8 +++++++- frontend/sass/commento-input.scss | 1 - frontend/sass/commento.scss | 9 ++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 7f01a14..020281c 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -64,6 +64,7 @@ var cdn = "[[[.CdnPrefix]]]"; var root = null; var cssOverride; + var noFonts; var autoInit; var isAuthenticated = false; var comments = []; @@ -1769,6 +1770,8 @@ if (ID_ROOT === undefined) { ID_ROOT = "commento"; } + + noFonts = attrGet(scripts[i], "data-no-fonts"); } } } @@ -1813,13 +1816,16 @@ var footer = footerLoad(); cssLoad(cdn + "/css/commento.css", "window.commento.loadCssOverride()"); + if (noFonts !== "true") { + classAdd(root, "root-font"); + } + selfGet(function() { commentsGet(function() { modToolsCreate(); rootCreate(function() { commentsRender(); append(root, footer); - attrSet(root, "style", ""); nameWidthFix(); loadHash(); global.allShow(); diff --git a/frontend/sass/commento-input.scss b/frontend/sass/commento-input.scss index d25b4cf..0a306ef 100644 --- a/frontend/sass/commento-input.scss +++ b/frontend/sass/commento-input.scss @@ -26,7 +26,6 @@ textarea::placeholder { textarea { display: inline-block; white-space: pre-wrap; - font-family: 'Source Sans Pro', sans-serif; padding: 8px; outline: none; overflow: auto; diff --git a/frontend/sass/commento.scss b/frontend/sass/commento.scss index 579e84d..21e63a0 100644 --- a/frontend/sass/commento.scss +++ b/frontend/sass/commento.scss @@ -4,13 +4,20 @@ min-height: 350px; } +.commento-root-font { + * { + font-family: 'Source Sans Pro', sans-serif !important; + } +} + .commento-root { overflow-x: hidden; padding: 0px; width: 100%; + font-family: inherit; * { - font-family: "Source Sans Pro", "Segoe UI", "Roboto", "Helvetica Neue", sans-serif; + font-family: inherit; font-size: 15px; line-height: 1.5; color: #50596c;