Does anyone know if it's possible to reassign a variable value inside a loop in LESS ???
I'm trying to exit a loop by reassiging the @extend-grid-breakpoint
variable to false...
Thanks!!!
.tst-container,
.tst-container-fluid {
.set-container();
}
each(.tst-container-max-widths(), .(@container-max-width-value, @container-max-width-name) {
.tst-container-@{container-max-width-name} {
&:extend(.tst-container-fluid);
}
@media (min-width: .tst-grid-breakpoints[$@container-max-width-name]) {
.tst-container {
max-width: @container-max-width-value;
}
/*
* setting the variable as true
*/
@extend-grid-breakpoint: true;
each(.tst-grid-breakpoints(), .(@grid-breakpoint-value, @grid-breakpoint-name) {
& when (@extend-grid-breakpoint) {
.tst-container-@{grid-breakpoint-name} {
&:extend(.tst-container);
}
/*
* I want to exit the loop by reassigning false to the variable
*/
& when (@container-max-width-name = @grid-breakpoint-name) {
@extend-grid-breakpoint: false;
}
}
});
}
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…