[英]CSS Less watch compiler - how to pass parameter and generate multiple copies of the CSS based on parameters?
我正在使用less-watch-compiler
:
https://github.com/jonycheung/deadsimple-less-watch-compiler
假设我有以下less
的文件:
@headerbackground: #fafafa;
header{
background: @headerbackground;
}
这工作正常。 但是,我需要创建 2 个 css 文件,并且能够将@headerbackground
作为参数传递给主题。
所以我想创建一个lightstyle.css
,其中#fafafa
headerbackground
一个darkstyle.css
,其中值为#000000
有没有办法做到这一点?
您必须使用此代码创建#LESS File First File Is MiXin.Less
.CreateHeader(@Color){
header{
background: @Color;
}
}
第二个文件是带有此代码的 lightstyle.less
@import "MiXin";
.CreateHeader(#FFF);
三文件是深色风格。少
@import "MiXin";
.CreateHeader(#FFF);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.