Namespace: Util:to-rem

Util:to-rem

Source:

Methods

to-rem($values, $baseopt, nullable) → {Number|List.<Number>}

Convert one or more px values to (a) rem value(s), based on a base font size in px, percent or rem. If the base is in % or rem, the base will be converted to px based on the global base font size.

Parameters:
Name Type Attributes Default Description
$values Number | List.<Number>

the value(s) to convert, usually px values, if a value is em, it will be treated as rem

$base Number <optional>
<nullable>
$jig---base-font-size-px

the base size to convert against

Source:
Returns:
the converted value(s)
Type
Number | List.<Number>
Example
to-rem(32px)
  => 2rem
to-rem((10px, 20px, 40px), 20px)
  => [0.5rem, 1rem, 2rem]