Skip to content

Instantly share code, notes, and snippets.

@vikt82
Created December 26, 2017 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vikt82/ebac10e7e2b34ba968dbf6da4d3d0cff to your computer and use it in GitHub Desktop.
Save vikt82/ebac10e7e2b34ba968dbf6da4d3d0cff to your computer and use it in GitHub Desktop.
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