home ~ projects ~ socials

Get The Pixel Value Of 1 CSS rem In JavaScript

The value of 1rem in CSS is can be determined with:

const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
-- end of line --