-
-
Save slavapas/421bf7475e72bf445f83f81a341f475e to your computer and use it in GitHub Desktop.
Stylus PX to REM Mixin
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
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