px-to-em
Convert a px value to an em value. That is, given a px value and an element, determine the equivalent em.
Usage
If you use ES modules, and if you use package.json
then import px-to-em
,
otherwise import pxToEm.mjs
. Alternatively, include pxToEm.js
in scope.
Given this HTML:
Hello World!
You can expect these outputs:
=== 1 === 2
Development
Run npm run develop
to continuously rebuild the project.
Start a web server in the test
directory, visit index.html
in a browser, and
check your console to see if the tests are passing.