mirror of
https://github.com/Jerryplusy/AI-powered-switches.git
synced 2025-07-04 21:29:18 +00:00
修theme
This commit is contained in:
parent
ccd37ce4e6
commit
ba6be9db49
@ -1,12 +1,14 @@
|
|||||||
'use client'
|
'use client';
|
||||||
|
import { ChakraProvider } from '@chakra-ui/react';
|
||||||
|
import { ColorModeProvider } from './color-mode';
|
||||||
|
import createSystem from '@/theme';
|
||||||
|
|
||||||
import { ChakraProvider, defaultSystem } from '@chakra-ui/react'
|
const system = createSystem;
|
||||||
import { ColorModeProvider } from './color-mode'
|
|
||||||
|
|
||||||
export function Provider(props) {
|
export function Provider(props) {
|
||||||
return (
|
return (
|
||||||
<ChakraProvider value={defaultSystem}>
|
<ChakraProvider value={system}>
|
||||||
<ColorModeProvider {...props} />
|
<ColorModeProvider {...props} />
|
||||||
</ChakraProvider>
|
</ChakraProvider>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
0
src/frontend/src/constants/keep
Normal file
0
src/frontend/src/constants/keep
Normal file
@ -3,7 +3,6 @@ import ReactDOM from 'react-dom/client';
|
|||||||
import App from '@/App';
|
import App from '@/App';
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
import { Provider } from '@/components/ui/provider';
|
import { Provider } from '@/components/ui/provider';
|
||||||
import system from '@/theme';
|
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||||
root.render(
|
root.render(
|
||||||
|
0
src/frontend/src/libs/keep
Normal file
0
src/frontend/src/libs/keep
Normal file
@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Box, Button, Heading, VStack } from '@chakra-ui/react';
|
import { Box, Button, Heading, VStack } from '@chakra-ui/react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import Card from '@/components/ui/Card';
|
|
||||||
|
|
||||||
const Welcome = () => {
|
const Welcome = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
0
src/frontend/src/resources/keep
Normal file
0
src/frontend/src/resources/keep
Normal file
@ -3,25 +3,21 @@ import { defineConfig, createSystem, defaultConfig } from '@chakra-ui/react';
|
|||||||
const config = defineConfig({
|
const config = defineConfig({
|
||||||
cssVarsRoot: ':where(:root, :host)',
|
cssVarsRoot: ':where(:root, :host)',
|
||||||
cssVarsPrefix: 'ck',
|
cssVarsPrefix: 'ck',
|
||||||
strictTokens: false,
|
strictTokens: true,
|
||||||
|
|
||||||
globalCss: {
|
globalCss: {}, //全局css
|
||||||
'html, body': {
|
|
||||||
margin: 0,
|
|
||||||
padding: 0,
|
|
||||||
fontFamily: "'Roboto', sans-serif",
|
|
||||||
backgroundColor: '{colors.bg}',
|
|
||||||
color: '{colors.text}',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
conditions: {
|
conditions: {
|
||||||
cqSm: '@container(min-width: 320px)',
|
child: '& > *', //子元素选择
|
||||||
child: '& > *',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
theme: {
|
theme: {
|
||||||
|
//核心主题配置
|
||||||
|
components: {
|
||||||
|
//组件样式
|
||||||
|
},
|
||||||
breakpoints: {
|
breakpoints: {
|
||||||
|
//响应式断点
|
||||||
sm: '320px',
|
sm: '320px',
|
||||||
md: '768px',
|
md: '768px',
|
||||||
lg: '960px',
|
lg: '960px',
|
||||||
@ -29,6 +25,7 @@ const config = defineConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
tokens: {
|
tokens: {
|
||||||
|
//基础主题
|
||||||
colors: {
|
colors: {
|
||||||
bg: '#f9fafb',
|
bg: '#f9fafb',
|
||||||
text: '#1a202c',
|
text: '#1a202c',
|
||||||
@ -46,6 +43,7 @@ const config = defineConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
semanticTokens: {
|
semanticTokens: {
|
||||||
|
//自定义标记
|
||||||
colors: {
|
colors: {
|
||||||
danger: { value: '{colors.red}' },
|
danger: { value: '{colors.red}' },
|
||||||
primary: { value: '{colors.primary}' },
|
primary: { value: '{colors.primary}' },
|
||||||
@ -54,6 +52,7 @@ const config = defineConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
keyframes: {
|
keyframes: {
|
||||||
|
//关键帧
|
||||||
fadeIn: {
|
fadeIn: {
|
||||||
from: { opacity: 0 },
|
from: { opacity: 0 },
|
||||||
to: { opacity: 1 },
|
to: { opacity: 1 },
|
||||||
@ -65,6 +64,7 @@ const config = defineConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
animationStyles: {
|
animationStyles: {
|
||||||
|
//预定义动画样式
|
||||||
fadeIn: {
|
fadeIn: {
|
||||||
animation: 'fadeIn 0.3s ease-in',
|
animation: 'fadeIn 0.3s ease-in',
|
||||||
},
|
},
|
||||||
@ -74,6 +74,7 @@ const config = defineConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
textStyles: {
|
textStyles: {
|
||||||
|
//文字样式
|
||||||
heading: {
|
heading: {
|
||||||
description: 'Page heading',
|
description: 'Page heading',
|
||||||
value: {
|
value: {
|
||||||
@ -90,6 +91,7 @@ const config = defineConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
layerStyles: {
|
layerStyles: {
|
||||||
|
//层样式
|
||||||
card: {
|
card: {
|
||||||
bg: 'white',
|
bg: 'white',
|
||||||
boxShadow: 'soft',
|
boxShadow: 'soft',
|
||||||
@ -100,6 +102,4 @@ const config = defineConfig({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const system = createSystem(defaultConfig, config);
|
export default createSystem(defaultConfig, config);
|
||||||
|
|
||||||
export default system;
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user