fix: 💄 different default font if cjk

This commit is contained in:
ThatOneCalculator 2023-07-13 17:11:59 -07:00
parent 293880f716
commit 2044196a23
2 changed files with 11 additions and 3 deletions

View file

@ -102,7 +102,11 @@
localStorage.setItem("fontSize", null);
fontSize = localStorage.getItem("fontSize");
}
document.documentElement.style.fontSize = fontSize + "px";
document.documentElement.style.fontSize = `${fontSize}px`;
}
if (["ja-JP", "ja-KS", "ko-KR", "zh-CN", "zh-TW"].includes(lang)) {
document.documentElement.classList.add("useCJKFont");
}
const useSystemFont = localStorage.getItem("useSystemFont");
@ -123,7 +127,7 @@
}
async function addStyle(styleText) {
let css = document.createElement("style");
const css = document.createElement("style");
css.appendChild(document.createTextNode(styleText));
document.head.appendChild(css);
}

View file

@ -39,7 +39,7 @@ html {
accent-color: var(--accent);
overflow: auto;
overflow-wrap: break-word;
font-family: "BIZ UDGothic", Roboto, HelveticaNeue, Arial, sans-serif;
font-family: Roboto, HelveticaNeue, Arial, sans-serif;
font-size: 14px;
line-height: 1.6;
text-size-adjust: 100%;
@ -47,6 +47,10 @@ html {
scroll-padding: 60px;
overflow-x: clip;
&.useCJKFont {
font-family: "Hiragino Maru Gothic Pro", "BIZ UDGothic", Roboto, HelveticaNeue, Arial, sans-serif;
}
&.useSystemFont {
font-family:
system-ui,