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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1038
18