I have few scss variables which looks like :
$box-bg1: #7a8360;
$box-bg2: #918261;
$box-bg3: #6a8177;
$box-bg4: #686f5e;
I want to use these variables inside a for, like :
@for $i from 1 through 4 {
.locationBox:nth-child(#{$i}) { background: $box-bg#{$i}; }
}
After compiling code i get this error : Syntax error: Undefined variable: "$box-bg", which looks like the #{$i}
variable does not make any sense for my code.
Is there a way to use a variable inside a loop like this?
Note : I also use compass