theme-class-generator
A function which can generate theme style classes from a simple config
Admin UI专用的主题样式类生成工具
使用示例
let classes = themeClassGenerator({
theme: {
colors: {
primary: '#1c86e2',
info: '#68217a',
warning: '#f5ae08',
danger: '#ea3a46',
success: '#0cb470',
'custom-color': '#f00'
},
shadows: {
primary: '2px 2px 4px #1c86e2',
info: '2px 2px 4px #68217a',
warning: '2px 2px 4px #f5ae08',
danger: '2px 2px 4px #ea3a46',
success: '2px 2px 4px #0cb470',
'custom-shadow': '3px 3px 6px #00f'
},
radiuses: {
small: '3px',
large: '5px'
'custom-radius': '13px'
}
},
prefix: 'au-theme',
lightnessReverse: false,
colorTopBottom: 10,
colorUpDown: 10,
baseColorLevel: 12,
baseColorHue: 10%,
baseShadowOpacity: 0.2,
colorShadowOpacity: 0.6
})
let style = document.createElement('style')
style.innerHTML = classes
document.getElementsByTagName('head')[0].appendChild(style)
具体使用详见Admin UI 文档 - 主题 章节