初始化移动端提交
This commit is contained in:
49
sheep/utils/theme.js
Normal file
49
sheep/utils/theme.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import themeConfig from '@/sheep/config/theme.js';
|
||||
|
||||
/**
|
||||
* 主题管理工具类 - 简化版,只提供主题色配置
|
||||
*/
|
||||
class ThemeManager {
|
||||
constructor() {
|
||||
this.config = themeConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前主题色
|
||||
*/
|
||||
getCurrentThemeColor() {
|
||||
return this.config.primary.main;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主题渐变
|
||||
* @param {string} type - 渐变类型 horizontal|vertical|diagonal
|
||||
*/
|
||||
getGradient(type = 'horizontal') {
|
||||
return this.config.gradients[type] || this.config.gradients.horizontal;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主题色变体
|
||||
*/
|
||||
getThemeColors() {
|
||||
return {
|
||||
main: this.config.primary.main,
|
||||
light: this.config.primary.light,
|
||||
dark: this.config.primary.dark,
|
||||
gradient: this.config.primary.gradient
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CSS变量
|
||||
*/
|
||||
getCSSVars() {
|
||||
return this.config.getCSSVars();
|
||||
}
|
||||
}
|
||||
|
||||
// 创建全局实例
|
||||
const themeManager = new ThemeManager();
|
||||
|
||||
export default themeManager;
|
||||
Reference in New Issue
Block a user