看板
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { reactive } from 'vue';
|
||||
import { lightPalette } from './theme-tokens';
|
||||
import type { ThemeColor } from '../../types/global';
|
||||
|
||||
// 使用 reactive 包装颜色对象,使其在运行时可被响应式读取与更新
|
||||
// 这个对象会被 configProvider 在主题切换时更新
|
||||
export const color = reactive<ThemeColor>({ ...lightPalette });
|
||||
|
||||
export default color;
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 组件库配置项类型定义
|
||||
*/
|
||||
import { reactive } from 'vue';
|
||||
import { version } from '../../package.json';
|
||||
import type { DarkMode } from '../../types/global';
|
||||
|
||||
export interface AppConfig {
|
||||
/** 版本号 */
|
||||
v: string;
|
||||
/** 版本号(冗余字段) */
|
||||
version: string;
|
||||
/** 主题名称列表 */
|
||||
type: string[];
|
||||
/** 默认主题名称 */
|
||||
defaultTheme: string;
|
||||
/** 默认暗黑主题 */
|
||||
defaultDarkMode: DarkMode;
|
||||
/** 默认语言 */
|
||||
defaultLocale: string;
|
||||
}
|
||||
|
||||
export const config = reactive<AppConfig>({
|
||||
v: version,
|
||||
version: version,
|
||||
// 主题名称
|
||||
type: ['primary', 'success', 'info', 'error', 'warning'],
|
||||
// 默认为官方主题名称
|
||||
defaultTheme: 'uviewpro',
|
||||
// 默认为亮色模式
|
||||
defaultDarkMode: 'light',
|
||||
// 默认为中文
|
||||
defaultLocale: 'zh-CN'
|
||||
});
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,102 @@
|
||||
import type { Theme, ThemeColor } from '../../types/global';
|
||||
import config from './config';
|
||||
|
||||
export const lightPalette: ThemeColor = {
|
||||
primary: '#2979ff',
|
||||
primaryDark: '#2b85e4',
|
||||
primaryDisabled: '#a0cfff',
|
||||
primaryLight: '#ecf5ff',
|
||||
success: '#19be6b',
|
||||
successDark: '#18b566',
|
||||
successDisabled: '#71d5a1',
|
||||
successLight: '#dbf1e1',
|
||||
warning: '#ff9900',
|
||||
warningDark: '#f29100',
|
||||
warningDisabled: '#fcbd71',
|
||||
warningLight: '#fdf6ec',
|
||||
error: '#fa3534',
|
||||
errorDark: '#dd6161',
|
||||
errorDisabled: '#fab6b6',
|
||||
errorLight: '#fef0f0',
|
||||
info: '#909399',
|
||||
infoDark: '#82848a',
|
||||
infoDisabled: '#c8c9cc',
|
||||
infoLight: '#f4f4f5',
|
||||
whiteColor: '#ffffff',
|
||||
blackColor: '#000000',
|
||||
mainColor: '#303133',
|
||||
contentColor: '#606266',
|
||||
tipsColor: '#909399',
|
||||
lightColor: '#c0c4cc',
|
||||
borderColor: '#dcdfe6',
|
||||
dividerColor: '#e4e7ed',
|
||||
maskColor: 'rgba(0, 0, 0, 0.4)',
|
||||
shadowColor: 'rgba(0, 0, 0, 0.1)',
|
||||
bgColor: '#f3f4f6',
|
||||
bgWhite: '#ffffff',
|
||||
bgGrayLight: '#f1f1f1',
|
||||
bgGrayDark: '#2f343c',
|
||||
bgBlack: '#000000'
|
||||
};
|
||||
|
||||
export const darkPalette: ThemeColor = {
|
||||
primary: '#8ab4ff',
|
||||
primaryDark: '#5f8dff',
|
||||
primaryDisabled: '#3d4f74',
|
||||
primaryLight: '#1d273f',
|
||||
success: '#4ade80',
|
||||
successDark: '#1f9d57',
|
||||
successDisabled: '#2f4d3d',
|
||||
successLight: '#10291f',
|
||||
warning: '#fbbf24',
|
||||
warningDark: '#c88f00',
|
||||
warningDisabled: '#4a3b17',
|
||||
warningLight: '#2b1f05',
|
||||
error: '#ff6b6b',
|
||||
errorDark: '#d83a3a',
|
||||
errorDisabled: '#4f2323',
|
||||
errorLight: '#2d1414',
|
||||
info: '#a0a7b8',
|
||||
infoDark: '#7c8394',
|
||||
infoDisabled: '#3b3f4c',
|
||||
infoLight: '#1d2029',
|
||||
whiteColor: '#f5f6f7',
|
||||
blackColor: '#f5f6f7',
|
||||
mainColor: '#f5f6f7',
|
||||
contentColor: '#cfd3dc',
|
||||
tipsColor: '#9aa1af',
|
||||
lightColor: '#6b7082',
|
||||
borderColor: '#3a4251',
|
||||
dividerColor: '#3a4251',
|
||||
maskColor: 'rgba(0, 0, 0, 0.6)',
|
||||
shadowColor: 'rgba(0, 0, 0, 0.3)',
|
||||
bgColor: '#111827',
|
||||
bgWhite: '#000000',
|
||||
bgGrayLight: '#1a1a1a',
|
||||
bgGrayDark: '#f5f7fa',
|
||||
bgBlack: '#ffffff'
|
||||
};
|
||||
|
||||
const lightCss: Record<string, string> = {
|
||||
'--u-background': '#ffffff',
|
||||
'--u-surface': '#f7f8fa',
|
||||
'--u-text': '#303133'
|
||||
};
|
||||
|
||||
const darkCss: Record<string, string> = {
|
||||
'--u-background': '#0f1115',
|
||||
'--u-surface': '#1c2233',
|
||||
'--u-text': '#f5f6f7'
|
||||
};
|
||||
|
||||
export const defaultThemes: Theme[] = [
|
||||
{
|
||||
name: config.defaultTheme,
|
||||
label: '默认蓝',
|
||||
description: 'uView Pro 默认主题,支持亮色与暗黑模式',
|
||||
color: lightPalette,
|
||||
darkColor: darkPalette,
|
||||
css: lightCss,
|
||||
darkCss: darkCss
|
||||
}
|
||||
];
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 组件库 z-index 配置项类型定义
|
||||
*/
|
||||
export interface ZIndexConfig {
|
||||
toast: number;
|
||||
noNetwork: number;
|
||||
/** popup包含popup,actionSheet,keyboard,picker的值 */
|
||||
popup: number;
|
||||
mask: number;
|
||||
navbar: number;
|
||||
topTips: number;
|
||||
sticky: number;
|
||||
indexListSticky: number;
|
||||
tabbar: number;
|
||||
}
|
||||
|
||||
const zIndex: ZIndexConfig = {
|
||||
toast: 10090,
|
||||
noNetwork: 10080,
|
||||
// popup包含popup,actionSheet,keyboard,picker的值
|
||||
popup: 10075,
|
||||
mask: 10070,
|
||||
navbar: 980,
|
||||
topTips: 975,
|
||||
sticky: 970,
|
||||
indexListSticky: 965,
|
||||
tabbar: 998
|
||||
};
|
||||
|
||||
export default zIndex;
|
||||
Reference in New Issue
Block a user