Skip to content

Instantly share code, notes, and snippets.

@e-river
Created January 22, 2014 03:29
Show Gist options
  • Save e-river/8553054 to your computer and use it in GitHub Desktop.
Save e-river/8553054 to your computer and use it in GitHub Desktop.
[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