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

to-rem

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-rem - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

16

index.js

@@ -1,3 +0,1 @@

var rootFontSize = 16; // By default browsers have a font-size of 16px.
/**

@@ -9,3 +7,3 @@ * Convert pixels to rem.

function convertToRem(pxValue) {
return pxValue / rootFontSize + 'rem';
return pxValue / 16 + 'rem';
}

@@ -15,11 +13,7 @@

* Convert a sequence of pixel values to rem values.
* @param {String|Number} pxValues values in px unit
* @return {String} values in rem unit
* @param {String|Number} px values in px unit
* @return {String} values in rem unit
*/
function rem(pxValues) {
var remValues = String(pxValues).split(' ');
remValues = remValues.map(convertToRem);
remValues = remValues.join(' ');
return remValues;
function rem(px) {
return String(px).split(' ').map(convertToRem).join(' ');
}

@@ -26,0 +20,0 @@

{
"name": "to-rem",
"version": "0.1.0",
"version": "0.1.1",
"description": "Convert pixels to rem.",

@@ -5,0 +5,0 @@ "license": "MIT",

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