I try to darken a variable number of divs like that
with following code:
You can darken the color using $i inside @for and apply respective classes to the divs. Hope this helps.
SCSS
@mixin color-divs ($count, $baseName, $startcolor) {
@for $i from 0 through $count {
$background-color: darken($startcolor, $i * $i);
.colored-div#{$i} {
background: $background-color;
height:100px;
width:200px;
float: left;
margin-right: 5px;
}
}
}
@include color-divs(5,'a',#ffd8b1);
HTML
a
b
c
d
e
Demo
See demo