Skip to content

Instantly share code, notes, and snippets.

@davaynamore
Last active April 10, 2019 09:19
Show Gist options
  • Save davaynamore/4c3d3d6c69d2f08fa194bd16a91a7f08 to your computer and use it in GitHub Desktop.
Save davaynamore/4c3d3d6c69d2f08fa194bd16a91a7f08 to your computer and use it in GitHub Desktop.
pixel to rem
$base-size: 16px;
@function px_to_rem($target, $context: $base-size) {
@if $target == 0 { @return 0 }
@return $target / $context + 0rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment