Package Exports
- convert-css-length
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (convert-css-length) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
convert-css-length
Convert between css lengths e.g. em->px or px->rem
Conversions between em, ex, rem, px are supported. PRs welcome if you need support for more esoteric length units.
Install
npm install convert-css-length
Usage
var convertLength = require('convert-css-length');
// Set the baseFontSize for your project. Defaults to 16px (also the
browser default).
var convert = convertLength('21px');
// Convert rem to px.
convert('1rem', 'px');
// ---> 16px
// Convert px to em.
convert('30px', 'em');
// ---> 1.875em