mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:33:45 +08:00
style: Improve Style
This commit is contained in:
parent
d23ef2bd59
commit
789d7000cf
@ -30,7 +30,6 @@
|
|||||||
padding: 5px 5px;
|
padding: 5px 5px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
scrollbar-gutter: stable;
|
scrollbar-gutter: stable;
|
||||||
background-color: var(--background-color);
|
|
||||||
|
|
||||||
.base-content {
|
.base-content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { ReactNode } from "react";
|
import React, { ReactNode } from "react";
|
||||||
import { Typography } from "@mui/material";
|
import { Typography, alpha } from "@mui/material";
|
||||||
import { BaseErrorBoundary } from "./base-error-boundary";
|
import { BaseErrorBoundary } from "./base-error-boundary";
|
||||||
|
import { useCustomTheme } from "@/components/layout/use-custom-theme";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
title?: React.ReactNode; // the page title
|
title?: React.ReactNode; // the page title
|
||||||
@ -11,6 +12,9 @@ interface Props {
|
|||||||
|
|
||||||
export const BasePage: React.FC<Props> = (props) => {
|
export const BasePage: React.FC<Props> = (props) => {
|
||||||
const { title, header, contentStyle, children } = props;
|
const { title, header, contentStyle, children } = props;
|
||||||
|
const { theme } = useCustomTheme();
|
||||||
|
|
||||||
|
const isDark = theme.palette.mode === "dark";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseErrorBoundary>
|
<BaseErrorBoundary>
|
||||||
@ -23,8 +27,17 @@ export const BasePage: React.FC<Props> = (props) => {
|
|||||||
{header}
|
{header}
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div className="base-container">
|
<div
|
||||||
<section>
|
className="base-container"
|
||||||
|
style={{ backgroundColor: isDark ? "#090909" : "#ffffff" }}
|
||||||
|
>
|
||||||
|
<section
|
||||||
|
style={{
|
||||||
|
backgroundColor: isDark
|
||||||
|
? alpha(theme.palette.primary.main, 0.1)
|
||||||
|
: "",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<div className="base-content" style={contentStyle} data-windrag>
|
<div className="base-content" style={contentStyle} data-windrag>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
@ -55,6 +55,9 @@ export const useCustomTheme = () => {
|
|||||||
primary: setting.primary_text || dt.primary_text,
|
primary: setting.primary_text || dt.primary_text,
|
||||||
secondary: setting.secondary_text || dt.secondary_text,
|
secondary: setting.secondary_text || dt.secondary_text,
|
||||||
},
|
},
|
||||||
|
background: {
|
||||||
|
paper: dt.background_color,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
typography: {
|
typography: {
|
||||||
// todo
|
// todo
|
||||||
|
@ -8,6 +8,7 @@ export const defaultTheme = {
|
|||||||
error_color: "#d32f2f",
|
error_color: "#d32f2f",
|
||||||
warning_color: "#ed6c02",
|
warning_color: "#ed6c02",
|
||||||
success_color: "#2e7d32",
|
success_color: "#2e7d32",
|
||||||
|
background_color: "#ffffff",
|
||||||
font_family: `"Roboto", "Helvetica", "Arial", sans-serif, "twemoji mozilla"`,
|
font_family: `"Roboto", "Helvetica", "Arial", sans-serif, "twemoji mozilla"`,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -15,5 +16,6 @@ export const defaultTheme = {
|
|||||||
export const defaultDarkTheme = {
|
export const defaultDarkTheme = {
|
||||||
...defaultTheme,
|
...defaultTheme,
|
||||||
primary_text: "#E8E8ED",
|
primary_text: "#E8E8ED",
|
||||||
|
background_color: "#181818",
|
||||||
secondary_text: "#bbbbbb",
|
secondary_text: "#bbbbbb",
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user