基于less实现换肤

themes

-skins

–dark.less

–white.less 对应皮肤的less变量

 

-with-skins.less 定义less函数

.with-skins(@rules){

:global(.skin-dark){@import (multiple) “./skins/dark.less”;@rules();}

:global(.skin-white){@import (multiple) “./skins/white.less”;@rules();}

}

 

body标签下加上div

某个涉及换肤的元素定义为

.with-skins({

.xx {

color:@c-fg;

}

});