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