styled-system
Advanced tools
Comparing version 1.0.0-14 to 1.0.0-15
@@ -46,3 +46,12 @@ 'use strict'; | ||
return function (n) { | ||
return num(n) ? px((scale[Math.abs(n)] || Math.abs(n)) * (neg(n) ? -1 : 1)) : n; | ||
if (!num(n)) { | ||
return n; | ||
} | ||
var value = scale[Math.abs(n)] || Math.abs(n); | ||
if (!num(value)) { | ||
return value; | ||
} | ||
return px(value * (neg(n) ? -1 : 1)); | ||
}; | ||
@@ -49,0 +58,0 @@ }; |
{ | ||
"name": "styled-system", | ||
"version": "1.0.0-14", | ||
"version": "1.0.0-15", | ||
"description": "Design system utilities for styled-components, glamorous, and other css-in-js libraries", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -41,6 +41,15 @@ const { | ||
const mx = scale => n => num(n) | ||
? px((scale[Math.abs(n)] || Math.abs(n)) * (neg(n) ? -1 : 1)) | ||
: n | ||
const mx = scale => n => { | ||
if (!num(n)) { | ||
return n | ||
} | ||
const value = scale[Math.abs(n)] || Math.abs(n) | ||
if (!num(value)) { | ||
return value | ||
} | ||
return px(value * (neg(n) ? -1 : 1)); | ||
} | ||
const getProperties = key => { | ||
@@ -66,2 +75,1 @@ const [ a, b ] = key.split('') | ||
} | ||
@@ -325,2 +325,7 @@ import test from 'ava' | ||
test('space can accept string values', t => { | ||
const a = space({ theme: { space: ['1em', '2em'] }, m: -1 }) | ||
t.deepEqual(a, {margin: '2em'}) | ||
}) | ||
// width | ||
@@ -327,0 +332,0 @@ test('width returns percentage widths', t => { |
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
40895
1208