Reputation: 329
I want to get the font size between two ranges.
$base-font: 1px;
@for $i from 1 through 100 {
.th-#{i} {
font-size: $base-font + $i + px;
}
}
When I am using class .th-30
, I am not getting a font size of 30px
.
Upvotes: 0
Views: 96
Reputation: 8368
You can just remove the $base-font
variable altogether. Also, you're missing a dollar sign in the selector:
@for $i from 1 through 100 {
.th-#{$i} {
font-size: $i + px;
}
}
Upvotes: 1
Reputation: 19542
Here are some changes you need to do.
There is no need for $base-font
here
$base-font: 1px;
@for $i from 1 through 100 {
.th-#{$i} {
font-size: #{$i}px;
}
}
Upvotes: 2