Skip to content

Instantly share code, notes, and snippets.

@didiraja
Created May 30, 2019 12:59
Show Gist options
  • Save didiraja/799aafa8f0cfad7c63ec54a1147b963c to your computer and use it in GitHub Desktop.
Save didiraja/799aafa8f0cfad7c63ec54a1147b963c to your computer and use it in GitHub Desktop.
Stylus/SASS/LESS - Converting Rem to Px
rem(value) { /* separate mixin, so it can be used elsewhere */
u = 'px';
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