Module: Converters
This module is a collection of functions for converting values between different CSS units.
You'll find it in src/modules/_converters.scss.
-
Function
length-remconverts any length unit to an approximate equivalent inrem. -
Function
length-pxconverts any length unit to an approximate equivalent inpx, but it also takes a given font-size into account. This function is useful for creating media-queries from a font-size-relative length value. -
Function
font-size-remconverts any font-size to an approximate equivalent inrem, even from named font-sizes likex-smallandlarger, as well as relative values in percentage and decimals. -
Function
font-size-pxconverts any font-size to an approximate equivalent inpx. -
Function
font-size-emconverts any font-size to an approximate equivalent inem.
Want better convertion rates?
It shouldn't be needed, but you can set your own convertion ratios before importing the module. Check out the Sass variables at the top of the module file for options!