This function generates a relative rem value from a pixel unit.
For example, to get a relational value of 12px, you can write rem(12)
when the base font size is 100%. If the base font-size is something other than 100%, you can pass the function a different base value (rem(12, 150%)
).
rem(12)
The pixel value without the unit (12
, not 12px
).
Default: The default can be found in the Rem settings file
The percentile font size set on html
. To set your own default, declare a $rem-base
variable somewhere.
.example {
font-size: rem(12);
}
.example {
font-size: 0.75rem;
}