-----
This commit is contained in:
46
src/utils/theme/theme.ts
Normal file
46
src/utils/theme/theme.ts
Normal file
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* 主题样式
|
||||
*/
|
||||
export interface ThemeCss {
|
||||
leftImg?: string;
|
||||
topImg?: string;
|
||||
backColor: string;
|
||||
borderColor: string;
|
||||
hoverColor: string;
|
||||
activeColor: string;
|
||||
textColor?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主题详情
|
||||
*/
|
||||
export class ThemeInfo {
|
||||
name: string;
|
||||
css: ThemeCss;
|
||||
|
||||
constructor(name: string, css: ThemeCss) {
|
||||
this.name = name;
|
||||
this.css = css;
|
||||
}
|
||||
};
|
||||
|
||||
export const ThemeType = {
|
||||
DEFAULT: new ThemeInfo('default', { leftImg: '', topImg: '', backColor: '', borderColor: '', hoverColor: '', activeColor: '', textColor: '' }),
|
||||
LIGHT: new ThemeInfo('light', { leftImg: '', topImg: '', backColor: '', borderColor: '', hoverColor: '', activeColor: '', textColor: '' }),
|
||||
}
|
||||
|
||||
export const AppTheme = {
|
||||
|
||||
info:ThemeType.DEFAULT,
|
||||
|
||||
setTheme(theme: ThemeInfo) {
|
||||
this.info = theme;
|
||||
},
|
||||
getTheme() {
|
||||
return this.info;
|
||||
},
|
||||
getThemeCss() {
|
||||
return this.info.css;
|
||||
},
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user