I am using CSS to create a catalog of hairstyles and colours. I have a combination of 55 different colours and hair styles. Each hair style and colour has its own image SVG file and I need to combine them all into a single background (Using the multiple background feature of CSS3).
I have written this mixing to generate the multiple backgrounds: (It is based on the mixin in this post)
@mixin style-matrix($colors, $styles) {
@each $s in $styles {
@each $c in $colors {
url("pps#{$s}#{$c}.svg"),
}
}
}
$colors: blonde, red, dkbrown, ltbrown, black;
$styles: hairboy1, hairboy2, hairboy3, hairboy4, hairboy5, hairgirl6, hairgirl1, hairgirl4, hairgirl2, hairgirl3, hairgirl5;
.hidden {
background: @include style-matrix($colors, $styles) url("base.svg);
}
(see codepen here)
However, every time I run the mixin, I get this error message:
Invalid CSS after "... url": expected "{", was "("pps#{$s}#{$c}..."
How can I use the mixin to generate the multiple backgrounds?