Skip to content

Instantly share code, notes, and snippets.

@delphinpro
Created November 15, 2017 00:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delphinpro/68327cc215582161e258d65ef29d18fb to your computer and use it in GitHub Desktop.
Save delphinpro/68327cc215582161e258d65ef29d18fb to your computer and use it in GitHub Desktop.
@function em($from, $to, $dimension: true) {
@return ($from / $to) * if($dimension, 1em, 1);
}
@function rem($px, $root: 16px) {
@return ($px / $root) * 1rem;
}
@mixin font($font-size, $line-height: null) {
font-size: rem($font-size);
line-height: if($line-height, em($line-height, $font-size, false), null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment