diff options
author | HombreLaser <sebastian-440@live.com> | 2024-02-08 16:36:31 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2024-02-08 16:36:31 -0600 |
commit | e182245d3205d929881f51da9b48d6c4ed97a682 (patch) | |
tree | d390e8754dec70a9c9293afb801321b96f043c15 /_sass/bourbon/functions/_px-to-rem.scss |
Diffstat (limited to '_sass/bourbon/functions/_px-to-rem.scss')
-rw-r--r-- | _sass/bourbon/functions/_px-to-rem.scss | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/_sass/bourbon/functions/_px-to-rem.scss b/_sass/bourbon/functions/_px-to-rem.scss new file mode 100644 index 0000000..0ac941e --- /dev/null +++ b/_sass/bourbon/functions/_px-to-rem.scss @@ -0,0 +1,15 @@ +// Convert pixels to rems +// eg. for a relational value of 12px write rem(12) +// Assumes $em-base is the font-size of <html> + +@function rem($pxval) { + @if not unitless($pxval) { + $pxval: strip-units($pxval); + } + + $base: $em-base; + @if not unitless($base) { + $base: strip-units($base); + } + @return ($pxval / $base) * 1rem; +} |