Created
August 20, 2015 05:47
-
-
Save gearmobile/2018978e82a0f924e3c8 to your computer and use it in GitHub Desktop.
Stylus PX to REM Mixin
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
set-font-size(value) { | |
font-size: value; /* добавляем PX как подстраховку */ | |
if (value is inherit) { | |
/* делаем если нет значения для шрифта */ | |
} else { | |
font-size: remify(value); | |
} | |
} | |
remify(value) { | |
u = unit(value); | |
if (u is 'px') { | |
return unit(value/16, 'rem'); | |
} else { | |
return unit(value, u); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment