Is it possible to put the following in a lessCSS forloop so that just the number of each section variable will update from section1 through to section4 with each loop?
// loop starts
.section1 {
.color {
color: @section1;
}
.colorBG-medium{
background-color: @section1;
}
.colorBG, .tab.active a {
background-color: @section1;
&:hover{
background-color: @section1;
}
}
}
// loop ends
thanks!
According to the link indicated by Roddy of the Frozen Peas, yes it is possible to do a loop, but it only makes sense to use it for numeric values. For your case, I recommend using the mixins, including to improve code readability:
The result: