I want to output multiple css files from one sass file. I have one file: schemes.scss, with code like this:
$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);
}
so that the result are 3 separate css files:
scheme-light.css:
body{
background-color: white;
}
h1{
color: #111;
}
.subheadline{
color: #222;
}
scheme-dark.css:
body{
background-color: black
}
h1{
color: #ddd;
}
.subheadline{
color: #eee;
}
scheme-moderate.css:
body{
background-color: gray
}
h1{
color: black;
}
.subheadline{
color: #333;
}
Is this possible with pure SASS? ..or with gulp (really prefer not).
Extracting common parts of sass and creating 3 different sass files is not a solution in my case. I have 9 schemes multiplied by dozens of complex components. Attaching scheme by class wrapper is not a solution either.