Skip to content

Instantly share code, notes, and snippets.

@lachlanjc
Created April 3, 2016 05:49
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 lachlanjc/ed27892b88a1477b30e22615a16cee0c to your computer and use it in GitHub Desktop.
Save lachlanjc/ed27892b88a1477b30e22615a16cee0c to your computer and use it in GitHub Desktop.
//-----------------------------
// Units functions
//-----------------------------
// Strip units from passed value
@function stripUnit($n) {
@return $n / ($n*0+1);
}
//---------------------------
// The rem() function returns the argument converted to rem.
// Argument: number to be converted.
//---------------------------
@function rem($amt) {
@return stripUnit($amt) * 1rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment