Skip to content

Instantly share code, notes, and snippets.

@jacubsmith
Created July 21, 2020 13:55
Show Gist options
  • Save jacubsmith/52af92e9afd22a4fc327e08a9ed3b5ee to your computer and use it in GitHub Desktop.
Save jacubsmith/52af92e9afd22a4fc327e08a9ed3b5ee to your computer and use it in GitHub Desktop.
// Convert pixels to ems
// eg. for a relational value of 12px write em(12) when the parent is 16px
// if the parent is another value say 24px write em(12, 24)
@function em($pxval, $base: $fzBase) {
@return ($pxval / $base) * 1em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment