I'd like to suffix whole number and decimal numbers to a CSS class selector with that very value passed on as a percent.
For example:
.percentage-100 would have a width of 100% - this works.
.percentage-50.5 would have a width width of 50.5% - this does not work.
That said, my Sass control directive is respecting whole numbers and assigning the value but not decimals.
I could use some insight from the Sass experts out there on what is currently wrong with this formula,
@for $i from 0 through 100 {
.percentage-#{$i} {
&:after {
$value: ($i * 1%);
width: $value;
}
}
}
Thanks again for your time.