Created
December 15, 2015 13:21
-
-
Save mistakster/2dceffdab9f2afdd8321 to your computer and use it in GitHub Desktop.
Revisions
-
mistakster created this gist
Dec 15, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ // 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(); }