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

@ -17,6 +17,8 @@ body {
--selection-color: #f5f5f5; --selection-color: #f5f5f5;
--scroller-color: #90939980; --scroller-color: #90939980;
--background-color: #ffffff; --background-color: #ffffff;
--background-color-alpha: rgba(24, 103, 192, 0.1);
--border-radius: 12px;
} }
::selection { ::selection {

View File

@ -18,6 +18,7 @@
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
overflow: hidden; overflow: hidden;
background-color: var(--background-color-alpha);
$maxLogo: 100px; $maxLogo: 100px;
@ -71,6 +72,7 @@
position: relative; position: relative;
flex: 1 1 75%; flex: 1 1 75%;
height: 100%; height: 100%;
background-color: var(--background-color-alpha);
.the-bar { .the-bar {
position: absolute; position: absolute;
@ -87,8 +89,8 @@
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
right: 2px; right: 28px;
bottom: 10px; bottom: 28px;
} }
} }
} }

View File

@ -6,7 +6,7 @@
> header { > header {
flex: 0 0 58px; flex: 0 0 58px;
width: 90%; width: 100%;
// max-width: 850px; // max-width: 850px;
margin: 0 auto; margin: 0 auto;
padding-right: 4px; padding-right: 4px;
@ -16,20 +16,27 @@
justify-content: space-between; justify-content: space-between;
} }
> section { .base-container {
position: relative;
flex: 1 1 100%;
width: 100%;
height: 100%; height: 100%;
overflow: auto; overflow: hidden;
padding: 8px 0; border-radius: var(--border-radius);
box-sizing: border-box;
scrollbar-gutter: stable;
.base-content { > section {
width: 90%; position: relative;
// max-width: 850px; flex: 1 1 100%;
margin: 0 auto; width: 100%;
height: 100%;
overflow: auto;
padding: 28px 0;
box-sizing: border-box;
scrollbar-gutter: stable;
background-color: var(--background-color);
.base-content {
width: 90%;
// max-width: 850px;
margin: 0 auto;
}
} }
} }
} }

View File

@ -23,11 +23,13 @@ export const BasePage: React.FC<Props> = (props) => {
{header} {header}
</header> </header>
<section> <div className="base-container">
<div className="base-content" style={contentStyle} data-windrag> <section>
{children} <div className="base-content" style={contentStyle} data-windrag>
</div> {children}
</section> </div>
</section>
</div>
</div> </div>
</BaseErrorBoundary> </BaseErrorBoundary>
); );

View File

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

View File

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