feat: Material You!

This commit is contained in:
keiko233
2023-11-11 17:12:57 +08:00
parent 23fb634847
commit b704706ee9
6 changed files with 39 additions and 22 deletions

View File

@@ -15,7 +15,7 @@ export const LayoutItem = (props: LinkProps) => {
selected={!!match}
sx={[
{
borderRadius: 2,
borderRadius: 8,
textAlign: "center",
"& .MuiListItemText-primary": { color: "text.secondary" },
},

View File

@@ -1,6 +1,6 @@
import { useEffect, useMemo } from "react";
import { useRecoilState } from "recoil";
import { createTheme, Theme } from "@mui/material";
import { alpha, createTheme, Theme } from "@mui/material";
import { appWindow } from "@tauri-apps/api/window";
import { atomThemeMode } from "@/services/states";
import { defaultTheme, defaultDarkTheme } from "@/pages/_theme";
@@ -93,6 +93,10 @@ export const useCustomTheme = () => {
rootEle.style.setProperty("--selection-color", selectColor);
rootEle.style.setProperty("--scroller-color", scrollColor);
rootEle.style.setProperty("--primary-main", theme.palette.primary.main);
rootEle.style.setProperty(
"--background-color-alpha",
alpha(theme.palette.primary.main, 0.1)
);
// inject css
let style = document.querySelector("style#verge-theme");