My code:
@for $j from 1 to 6 {
.text-#($j) { font-size: 15px * $j; }
}
I'm facing an issue where my code doesn't run as expected. In an attempt to fix this, I modified it to use a 'through' keyword instead of 'to' in the loop declaration:
@for $j from 1 through 5 {
.text-#($j) { font-size: 15px * $j; }
}
Unfortunately, both versions result in invalid CSS errors and do not work properly.
@for $j from 1 through 5 {
Upon checking the suggested solution (from freecodecamp), I found the following correct version:
@for $j from 1 through 5 {
.text-#{$j} { font-size: 15px * $j; }
}
This brings me to the dilemma of why the listed solution works perfectly while my practically identical code fails to function. Even after scrutinizing multiple times, I am unable to spot any differences. How could this be?