elishaterada
8/25/2018 - 7:05 AM

Pixels to REM value

Pixels to REM value

const baseFontSize = 16;

const pxToRem = (px) => {
  const value = px / baseFontSize;
  return `${value}rem`;
};

export default pxToRem;