Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

convert-css-length

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convert-css-length - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "convert-css-length",
"description": "Convert between css lengths e.g. em->px or px->rem",
"version": "1.0.0",
"version": "1.0.1",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",

@@ -6,0 +6,0 @@ "bugs": {

@@ -7,2 +7,4 @@ # convert-css-length

*[Note: algorithm was originally ported from Compass] (https://github.com/Compass/compass/blob/master/core/stylesheets/compass/typography/_units.scss)*
## Install

@@ -16,3 +18,3 @@ `npm install convert-css-length`

// Set the baseFontSize for your project. Defaults to 16px (also the
browser default).
// browser default).
var convert = convertLength('21px');

@@ -27,2 +29,9 @@

// ---> 1.875em
// Convert em to pixels using fromContext.
// em(s) are relative to the font-size at the same node. If you're setting an em on a node whose font-size
// is different than the base font size, you'll need to pass that font-size as the third parameter.
// Or just use rem instead which sizes everything relative to the base node.
convert('1em', 'px', '14px')
// ---> 14px
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc