style: 滚动条主题更新 & 页面背景色更新
This commit is contained in:
@@ -73,6 +73,13 @@ const Insider = (props: InsiderProps) => {
|
|||||||
globalMessage.setMessage(message);
|
globalMessage.setMessage(message);
|
||||||
}, [message]);
|
}, [message]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.documentElement.setAttribute(
|
||||||
|
'data-color-scheme',
|
||||||
|
theme === Theme.DARK ? 'dark' : 'light',
|
||||||
|
);
|
||||||
|
}, [theme]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HelmetProvider context={helmetContext}>
|
<HelmetProvider context={helmetContext}>
|
||||||
<IntlProvider locale={locale} messages={langsMap[locale]}>
|
<IntlProvider locale={locale} messages={langsMap[locale]}>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
.main {
|
.main {
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
background: var(--toco-colorBgBase);
|
background: var(--toco-colorBgContainer);
|
||||||
border-radius: var(--toco-borderRadiusLG);
|
border-radius: var(--toco-borderRadiusLG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
padding: 24px;
|
padding: 24px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: 280px;
|
min-height: 280px;
|
||||||
background: var(--toco-colorBgBase);
|
background: var(--toco-colorBgContainer);
|
||||||
border-radius: var(--toco-borderRadiusLG);
|
border-radius: var(--toco-borderRadiusLG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,4 +8,12 @@ html, body {
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
max-height: 100vh;
|
max-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-color-scheme="dark"] {
|
||||||
|
color-scheme: dark;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-color-scheme="light"] {
|
||||||
|
color-scheme: light;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user