I try to darken a variable number of divs like that
with following code:
I created this example based on your mixin:
@mixin color-divs ($count, $baseName, $startcolor) {
$loop_color: $startcolor;
@for $i from 0 through $count {
$loop_color: darken($loop_color, 9%);
.#{$baseName}-#{$i} { background-color: $loop_color; }
}
}
div {
width: 100px;
height: 100px;
float: left;
}
@include color-divs(6,'div',#faa)
Used with the following markup:
Output: http://jsfiddle.net/jdtvF/
http://uk.omg.li/P0dF/by%20default%202013-05-16%20at%2010.10.43.png
div {
width: 100px;
height: 100px;
float: left; }
.div-0 {
background-color: #ff7c7c; }
.div-1 {
background-color: #ff4e4e; }
.div-2 {
background-color: #ff2020; }
.div-3 {
background-color: #f10000; }
.div-4 {
background-color: #c30000; }
.div-5 {
background-color: #960000; }
.div-6 {
background-color: #680000; }