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-rem
converts any length unit to an approximate equivalent inrem
. -
Function
length-px
converts 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-rem
converts any font-size to an approximate equivalent inrem
, even from named font-sizes likex-small
andlarger
, as well as relative values in percentage and decimals. -
Function
font-size-px
converts any font-size to an approximate equivalent inpx
. -
Function
font-size-em
converts 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!