frontend: add option to not use Source Sans Pro

Closes https://gitlab.com/commento/commento/issues/136
This commit is contained in:
Adhityaa Chandrasekar 2019-05-01 18:10:07 -04:00
parent 409af7f205
commit 5b6d31ce31
3 changed files with 15 additions and 3 deletions

View File

@ -64,6 +64,7 @@
var cdn = "[[[.CdnPrefix]]]"; var cdn = "[[[.CdnPrefix]]]";
var root = null; var root = null;
var cssOverride; var cssOverride;
var noFonts;
var autoInit; var autoInit;
var isAuthenticated = false; var isAuthenticated = false;
var comments = []; var comments = [];
@ -1769,6 +1770,8 @@
if (ID_ROOT === undefined) { if (ID_ROOT === undefined) {
ID_ROOT = "commento"; ID_ROOT = "commento";
} }
noFonts = attrGet(scripts[i], "data-no-fonts");
} }
} }
} }
@ -1813,13 +1816,16 @@
var footer = footerLoad(); var footer = footerLoad();
cssLoad(cdn + "/css/commento.css", "window.commento.loadCssOverride()"); cssLoad(cdn + "/css/commento.css", "window.commento.loadCssOverride()");
if (noFonts !== "true") {
classAdd(root, "root-font");
}
selfGet(function() { selfGet(function() {
commentsGet(function() { commentsGet(function() {
modToolsCreate(); modToolsCreate();
rootCreate(function() { rootCreate(function() {
commentsRender(); commentsRender();
append(root, footer); append(root, footer);
attrSet(root, "style", "");
nameWidthFix(); nameWidthFix();
loadHash(); loadHash();
global.allShow(); global.allShow();

View File

@ -26,7 +26,6 @@ textarea::placeholder {
textarea { textarea {
display: inline-block; display: inline-block;
white-space: pre-wrap; white-space: pre-wrap;
font-family: 'Source Sans Pro', sans-serif;
padding: 8px; padding: 8px;
outline: none; outline: none;
overflow: auto; overflow: auto;

View File

@ -4,13 +4,20 @@
min-height: 350px; min-height: 350px;
} }
.commento-root-font {
* {
font-family: 'Source Sans Pro', sans-serif !important;
}
}
.commento-root { .commento-root {
overflow-x: hidden; overflow-x: hidden;
padding: 0px; padding: 0px;
width: 100%; width: 100%;
font-family: inherit;
* { * {
font-family: "Source Sans Pro", "Segoe UI", "Roboto", "Helvetica Neue", sans-serif; font-family: inherit;
font-size: 15px; font-size: 15px;
line-height: 1.5; line-height: 1.5;
color: #50596c; color: #50596c;