Created
December 15, 2015 13:21
-
-
Save mistakster/2dceffdab9f2afdd8321 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Conver scale factor into pixels | |
.fontScale(@scale: 0) { | |
@list: 14px, 16px, 20px, 24px, 28px, 34px, 41px, 50px, 60px; | |
.test-args(@scale) when (@scale >= -2) and (@scale <= 6) { | |
font-size: extract(@list, @scale + 3); | |
} | |
.test-args(@scale); | |
} | |
// Apply font with provided size or scale | |
.fontTimes(@size: "") { | |
font-family: "Times New Roman", serif; | |
.test-args() when (ispixel(@size)) { | |
font-size: @size; | |
} | |
.test-args() when (isnumber(@size)) and not (ispixel(@size)) { | |
.fontScale(@size); | |
} | |
.test-args(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment