feat: Theme support modify --background-color

This commit is contained in:
keiko233 2023-10-20 11:12:49 +08:00
parent b060b4b9bf
commit 70fcfe6d6c
2 changed files with 3 additions and 0 deletions

View file

@ -16,6 +16,7 @@ body {
--text-primary: #637381;
--selection-color: #f5f5f5;
--scroller-color: #90939980;
--background-color: #ffffff;
}
::selection {

View file

@ -84,10 +84,12 @@ export const useCustomTheme = () => {
}
// css
const backgroundColor = mode === "light" ? "#ffffff" : "#121212";
const selectColor = mode === "light" ? "#f5f5f5" : "#d5d5d5";
const scrollColor = mode === "light" ? "#90939980" : "#54545480";
const rootEle = document.documentElement;
rootEle.style.setProperty("--background-color", backgroundColor);
rootEle.style.setProperty("--selection-color", selectColor);
rootEle.style.setProperty("--scroller-color", scrollColor);
rootEle.style.setProperty("--primary-main", theme.palette.primary.main);