Last active
June 19, 2018 16:16
-
-
Save miladd3/4a8505b28a4269a75ea84231ed795f18 to your computer and use it in GitHub Desktop.
font size in em scss loop from 1em to 4 em
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice. thanks for sharing.
i will use this in https://github.com/framevuerk/framevuerk/tree/v2