feat: Theme support modify --background-color
This commit is contained in:
parent
b060b4b9bf
commit
70fcfe6d6c
2 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,7 @@ body {
|
|||
--text-primary: #637381;
|
||||
--selection-color: #f5f5f5;
|
||||
--scroller-color: #90939980;
|
||||
--background-color: #ffffff;
|
||||
}
|
||||
|
||||
::selection {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue