Skip to content

Instantly share code, notes, and snippets.

@Coordinate-Cat
Last active March 22, 2021 00:58
Show Gist options
  • Save Coordinate-Cat/db31fc462d9ffacc52b4e90f78645b8e to your computer and use it in GitHub Desktop.
Save Coordinate-Cat/db31fc462d9ffacc52b4e90f78645b8e to your computer and use it in GitHub Desktop.
@for $i from 0 through 100 {
&.cell-#{$i * 5} {
width:round(percentage($i * 5/100));
}
}
// output↓
// html
class="cell-5"
class="cell-10"
class="cell-15"
class="cell-20"
...
// css
.cell-5 {
width: 5%;
}
.cell-10 {
width: 10%;
}
.cell-15 {
width: 15%;
}
.cell-20 {
width: 20%;
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment