mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 09:57:29 -07:00
fix: 💄 different default font if cjk
This commit is contained in:
parent
293880f716
commit
2044196a23
2 changed files with 11 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue