Skip to content

Instantly share code, notes, and snippets.

@miladd3
Last active June 19, 2018 16:16
Show Gist options
  • Save miladd3/4a8505b28a4269a75ea84231ed795f18 to your computer and use it in GitHub Desktop.
Save miladd3/4a8505b28a4269a75ea84231ed795f18 to your computer and use it in GitHub Desktop.
font size in em scss loop from 1em to 4 em
/**
this snippet is handy when u need to use font sizes in em
this will compile to css like this
.fz-0-1em {
font-size: 0.1em;
}
and it will loop through to
.fz-4em {
font-size: 4em;
}
*/
@for $i from 0 through 4 {
@for $j from 0 through 9 {
@if($j == 0) {
.fz-#{$i}em {
font-size: #{$i}em !important;
}
}@else {
.fz-#{$i}-#{$j}em {
font-size: #{$i}#{'.'}#{$j}em !important;
}
}
}
}
@nainemom
Copy link

nice. thanks for sharing.
i will use this in https://github.com/framevuerk/framevuerk/tree/v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment