我想从一个sass文件输出多个css文件.我有一个文件:schemes.scss,代码如下:
$schemes: (
'light': (
'body-background': white,
'headline-color' : #111,
'subheadline-color': #222
),
'dark': (
'body-background': black,
'headline-color' : #ddd,
'subheadline-color' : #eee
),
'moderate': (
'body-background': gray,
'headline-color' : black,
'subheadline-color' : #333
)
);
@each $scheme in $schemes{
//do something to export to separate file
@include scheme-base-mixin($scheme);
}
Run Code Online (Sandbox Code Playgroud)
所以结果是3个单独的css文件:
scheme-light.css:
body{
background-color: white;
}
h1{
color: #111;
}
.subheadline{
color: #222;
}
Run Code Online (Sandbox Code Playgroud)
scheme-dark.css:
body{
background-color: black
}
h1{
color: #ddd;
}
.subheadline{
color: #eee; …Run Code Online (Sandbox Code Playgroud)