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-em.scss |
Diffstat (limited to '_sass/bourbon/functions/_px-to-em.scss')
-rw-r--r-- | _sass/bourbon/functions/_px-to-em.scss | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/_sass/bourbon/functions/_px-to-em.scss b/_sass/bourbon/functions/_px-to-em.scss new file mode 100644 index 0000000..ae81a44 --- /dev/null +++ b/_sass/bourbon/functions/_px-to-em.scss @@ -0,0 +1,13 @@ +// 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: $em-base) { + @if not unitless($pxval) { + $pxval: strip-units($pxval); + } + @if not unitless($base) { + $base: strip-units($base); + } + @return ($pxval / $base) * 1em; +} |