mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-05-06 05:48:41 +00:00
fix: resolve theme switching conflicts and layout shaking by refining Font CSS and ForceTheme logic
This commit is contained in:
+3
-1
@@ -47,7 +47,9 @@ const MainApp: React.FC = () => {
|
|||||||
window.ForceTheme as string !== "" ? window.ForceTheme : undefined;
|
window.ForceTheme as string !== "" ? window.ForceTheme : undefined;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (forceTheme === "dark" || forceTheme === "light") {
|
const savedTheme = localStorage.getItem("vite-ui-theme");
|
||||||
|
// Only auto-apply ForceTheme if the user hasn't manually picked one (or picked 'system')
|
||||||
|
if ((!savedTheme || savedTheme === "system") && (forceTheme === "dark" || forceTheme === "light")) {
|
||||||
setTheme(forceTheme);
|
setTheme(forceTheme);
|
||||||
}
|
}
|
||||||
}, [forceTheme, setTheme]);
|
}, [forceTheme, setTheme]);
|
||||||
|
|||||||
+2
-2
@@ -190,7 +190,6 @@
|
|||||||
@layer base {
|
@layer base {
|
||||||
* {
|
* {
|
||||||
@apply border-border;
|
@apply border-border;
|
||||||
font-family: 'LXGW WenKai Screen', sans-serif !important;
|
|
||||||
}
|
}
|
||||||
html {
|
html {
|
||||||
@apply scroll-smooth;
|
@apply scroll-smooth;
|
||||||
@@ -200,9 +199,10 @@
|
|||||||
/* font-feature-settings: "rlig" 1, "calt" 1; */
|
/* font-feature-settings: "rlig" 1, "calt" 1; */
|
||||||
font-synthesis-weight: none;
|
font-synthesis-weight: none;
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
|
font-family: 'LXGW WenKai Screen', sans-serif;
|
||||||
}
|
}
|
||||||
h1, h2, h3, h4, h5, h6 {
|
h1, h2, h3, h4, h5, h6 {
|
||||||
font-family: 'LXGW WenKai Screen', sans-serif !important;
|
font-family: 'LXGW WenKai Screen', sans-serif;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user