Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 413 Bytes

pxToRem.md

File metadata and controls

22 lines (13 loc) · 413 Bytes

pxToRem

Convert px metric to rem, using an optional baseline as argument.

Arguments

  • pixel: number: value to be converted
  • base?: number: optional baseline, normally 16

Returns

  • rem: string: The result between the pixel and base calculation

Usage

import { pxToRem } from '@platformbuilders/helpers';

pxToRem(20); // return '1.25rem'

pxToRem(20, 20); // return '1rem'