Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Sass]Adding a 0 if only one digit serial number of the class name
$num: "";
@for $i from 1 through 10 {
@if $i < 10 {
$num: "0#{$i}";
} @else {
$num: "#{$i}";
}
.classname#{$num} {
// CSS code here
}
}
//.classname01{}
//.classname02{}
//.classname03{}
//.classname04{}
//.classname05{}
//.classname06{}
//.classname07{}
//.classname08{}
//.classname09{}
//.classname10{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment