{"_id":"convert-css-length","_rev":"286245","name":"convert-css-length","description":"Convert between css lengths e.g. em->px or px->rem","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"kylemathews","email":""}],"time":{"modified":"2021-06-03T18:35:57.000Z","created":"2015-02-11T01:26:03.063Z","2.0.1":"2019-07-09T16:12:37.422Z","2.0.0":"2019-06-01T01:31:32.249Z","1.0.2":"2018-04-24T01:55:35.870Z","1.0.1":"2015-02-11T04:30:56.888Z","1.0.0":"2015-02-11T01:26:03.063Z"},"users":{},"author":{"name":"Kyle Mathews","email":"mathews.kyle@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/KyleAMathews/convert-css-length.git"},"versions":{"2.0.1":{"name":"convert-css-length","description":"Convert between css lengths e.g. em->px or px->rem","version":"2.0.1","author":{"name":"Kyle Mathews","email":"mathews.kyle@gmail.com"},"bugs":{"url":"https://github.com/KyleAMathews/convert-css-length/issues"},"dependencies":{},"devDependencies":{"chai":"^1.10.0","coffee-script":"^1.9.0","esm":"^3.2.25","microbundle":"^0.11.0","mocha":"^2.1.0","mocha-unfunk-reporter":"^0.4.0","prettier":"^1.12.1"},"homepage":"https://github.com/KyleAMathews/convert-css-length","keywords":["css","css","length","convert","units","sass","compass"],"license":"MIT","source":"src/index.js","main":"dist/index.js","module":"dist/index.esm.js","repository":{"type":"git","url":"git+https://github.com/KyleAMathews/convert-css-length.git"},"scripts":{"test":"mocha -r esm test/*.js","build":"microbundle","publish-patch":"npm run build && npm version patch && npm publish","format":"prettier --write src/index.js"},"gitHead":"a3bbadfe1169b59dc019b4e74ddf8031d3b55393","_id":"convert-css-length@2.0.1","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"shasum":"90a76bde5bfd24d72881a5b45d02249b2c1d257c","size":5464,"noattachment":false,"key":"/convert-css-length/-/convert-css-length-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/convert-css-length/download/convert-css-length-2.0.1.tgz"},"maintainers":[{"name":"kylemathews","email":""}],"_npmUser":{"name":"kylemathews","email":"mathews.kyle@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/convert-css-length_2.0.1_1562688757321_0.936349020306392"},"_hasShrinkwrap":false,"publish_time":1562688757422,"_cnpm_publish_time":1562688757422},"2.0.0":{"name":"convert-css-length","description":"Convert between css lengths e.g. em->px or px->rem","version":"2.0.0","author":{"name":"Kyle Mathews","email":"mathews.kyle@gmail.com"},"bugs":{"url":"https://github.com/KyleAMathews/convert-css-length/issues"},"dependencies":{"console-polyfill":"^0.1.2","parse-unit":"^1.0.1"},"devDependencies":{"chai":"^1.10.0","coffee-script":"^1.9.0","esm":"^3.2.25","microbundle":"^0.11.0","mocha":"^2.1.0","mocha-unfunk-reporter":"^0.4.0","prettier":"^1.12.1"},"homepage":"https://github.com/KyleAMathews/convert-css-length","keywords":["css","css","length","convert","units","sass","compass"],"license":"MIT","source":"src/index.js","main":"dist/index.js","module":"dist/index.esm.js","repository":{"type":"git","url":"git+https://github.com/KyleAMathews/convert-css-length.git"},"scripts":{"test":"mocha -r esm test/index.js","build":"microbundle","format":"prettier --write src/index.js"},"gitHead":"3cca1dfc26c691f8c9524a619ae96f97e08ef2a0","_id":"convert-css-length@2.0.0","_nodeVersion":"10.9.0","_npmVersion":"6.8.0","dist":{"shasum":"0c60ff686e70625ef7f3fd305a2f61f33a96c289","size":5321,"noattachment":false,"key":"/convert-css-length/-/convert-css-length-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/convert-css-length/download/convert-css-length-2.0.0.tgz"},"maintainers":[{"name":"kylemathews","email":""}],"_npmUser":{"name":"kylemathews","email":"mathews.kyle@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/convert-css-length_2.0.0_1559352692144_0.21283757723150964"},"_hasShrinkwrap":false,"publish_time":1559352692249,"_cnpm_publish_time":1559352692249},"1.0.2":{"name":"convert-css-length","description":"Convert between css lengths e.g. em->px or px->rem","version":"1.0.2","author":{"name":"Kyle Mathews","email":"mathews.kyle@gmail.com"},"bugs":{"url":"https://github.com/KyleAMathews/convert-css-length/issues"},"dependencies":{"console-polyfill":"^0.1.2","parse-unit":"^1.0.1"},"devDependencies":{"chai":"^1.10.0","coffee-script":"^1.9.0","microbundle":"^0.4.4","mocha":"^2.1.0","mocha-unfunk-reporter":"^0.4.0","prettier":"^1.12.1"},"homepage":"https://github.com/KyleAMathews/convert-css-length","keywords":["css","css","length","convert","units","sass","compass"],"license":"MIT","source":"src/index.js","main":"dist/index.js","repository":{"type":"git","url":"git+https://github.com/KyleAMathews/convert-css-length.git"},"scripts":{"build":"microbundle","format":"prettier --write src/index.js"},"gitHead":"74a6562195a84437ddbd522fe693c617607d9e54","_id":"convert-css-length@1.0.2","_npmVersion":"5.8.0","_nodeVersion":"8.7.0","_npmUser":{"name":"kylemathews","email":"mathews.kyle@gmail.com"},"dist":{"shasum":"32f38a8ac55d78372ff43562532564366c871ccc","size":38059,"noattachment":false,"key":"/convert-css-length/-/convert-css-length-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/convert-css-length/download/convert-css-length-1.0.2.tgz"},"maintainers":[{"name":"kylemathews","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/convert-css-length_1.0.2_1524534935768_0.22840226316270007"},"_hasShrinkwrap":false,"publish_time":1524534935870,"_cnpm_publish_time":1524534935870},"1.0.1":{"name":"convert-css-length","description":"Convert between css lengths e.g. em->px or px->rem","version":"1.0.1","author":{"name":"Kyle Mathews","email":"mathews.kyle@gmail.com"},"bugs":{"url":"https://github.com/KyleAMathews/convert-css-length/issues"},"dependencies":{"console-polyfill":"^0.1.2","parse-unit":"^1.0.1"},"devDependencies":{"chai":"^1.10.0","coffee-script":"^1.9.0","mocha":"^2.1.0","mocha-unfunk-reporter":"^0.4.0"},"homepage":"https://github.com/KyleAMathews/convert-css-length","keywords":["css","css","length","convert","units","sass","compass"],"license":"MIT","main":"dist/index.js","repository":{"type":"git","url":"https://github.com/KyleAMathews/convert-css-length.git"},"scripts":{"test":"NODE_ENV=test node_modules/.bin/mocha -w --recursive --compilers coffee:coffee-script/register -R mocha-unfunk-reporter"},"gitHead":"3620646c8b366c7ead36e5b2826641df46b4fad2","_id":"convert-css-length@1.0.1","_shasum":"f3ecec664f2e873a0570e6afdd3e1ae4f92444b7","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.35","_npmUser":{"name":"kylemathews","email":"mathews.kyle@gmail.com"},"maintainers":[{"name":"kylemathews","email":""}],"dist":{"shasum":"f3ecec664f2e873a0570e6afdd3e1ae4f92444b7","size":18567,"noattachment":false,"key":"/convert-css-length/-/convert-css-length-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/convert-css-length/download/convert-css-length-1.0.1.tgz"},"directories":{},"publish_time":1423629056888,"_cnpm_publish_time":1423629056888,"_hasShrinkwrap":false},"1.0.0":{"name":"convert-css-length","description":"Convert between css lengths e.g. em->px or px->rem","version":"1.0.0","author":{"name":"Kyle Mathews","email":"mathews.kyle@gmail.com"},"bugs":{"url":"https://github.com/KyleAMathews/convert-css-length/issues"},"dependencies":{"console-polyfill":"^0.1.2","parse-unit":"^1.0.1"},"devDependencies":{"chai":"^1.10.0","coffee-script":"^1.9.0","mocha":"^2.1.0","mocha-unfunk-reporter":"^0.4.0"},"homepage":"https://github.com/KyleAMathews/convert-css-length","keywords":["css","css","length","convert","units","sass","compass"],"license":"MIT","main":"dist/index.js","repository":{"type":"git","url":"https://github.com/KyleAMathews/convert-css-length.git"},"scripts":{"test":"NODE_ENV=test node_modules/.bin/mocha -w --recursive --compilers coffee:coffee-script/register -R mocha-unfunk-reporter"},"gitHead":"4b5ccc2b7f9ddcd618f059f075d9e54131434299","_id":"convert-css-length@1.0.0","_shasum":"8d5c521b8b95189a99102843a003c01b0009e0d4","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.35","_npmUser":{"name":"kylemathews","email":"mathews.kyle@gmail.com"},"maintainers":[{"name":"kylemathews","email":""}],"dist":{"shasum":"8d5c521b8b95189a99102843a003c01b0009e0d4","size":17761,"noattachment":false,"key":"/convert-css-length/-/convert-css-length-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/convert-css-length/download/convert-css-length-1.0.0.tgz"},"directories":{},"publish_time":1423617963063,"_cnpm_publish_time":1423617963063,"_hasShrinkwrap":false}},"readme":"# convert-css-length\nConvert between css lengths e.g. em->px or px->rem\n\nConversions between em, ex, rem, px are supported. PRs welcome if\nyou need support for more esoteric length units.\n\n*[Note: algorithm was originally ported from Compass] (https://github.com/Compass/compass/blob/master/core/stylesheets/compass/typography/_units.scss)*\n\n## Install\n`npm install convert-css-length`\n\n## Usage\n```javascript\nimport convertLength from 'convert-css-length';\n\n// Set the baseFontSize for your project. Defaults to 16px (also the\n// browser default).\nvar convert = convertLength('21px');\n\n// Convert rem to px.\nconvert('1rem', 'px');\n// ---> 21px\n\n// Convert px to em.\nconvert('30px', 'em');\n// ---> 1.42857em\n\n// Convert em to pixels using fromContext.\n// em(s) are relative to the font-size at the same element. If you're setting an em on a element whose font-size\n// is different than the base font size, you'll need to pass that font-size as the third parameter.\n// Or just use rem instead which sizes everything relative to the base node.\nconvert('1em', 'px', '14px')\n// ---> 14px\n```\n","_attachments":{},"homepage":"https://github.com/KyleAMathews/convert-css-length","bugs":{"url":"https://github.com/KyleAMathews/convert-css-length/issues"},"license":"MIT"}