Created
July 9, 2021 16:02
-
-
Save haroldao/5f22a925a9764bc090a000d14ac9722e to your computer and use it in GitHub Desktop.
px to em/rem | SCSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://css-tricks.com/snippets/sass/px-to-em-functions/ | |
@function rem($pixels, $context: 16) { | |
@return (math.div($pixels, $context)) * 1rem; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment