@styled-system/css
Advanced tools
Comparing version 5.0.9 to 5.0.10
@@ -5,8 +5,4 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
export var get = function get(obj, key, def, p, undef) { | ||
if (key === void 0) { | ||
key = ''; | ||
} | ||
key = key && key.split ? key.split('.') : [key]; | ||
key = key.split ? key.split('.') : [key]; | ||
for (p = 0; p < key.length; p++) { | ||
@@ -66,2 +62,6 @@ obj = obj ? obj[key[p]] : undef; | ||
paddingY: 'space', | ||
top: 'space', | ||
right: 'space', | ||
bottom: 'space', | ||
left: 'space', | ||
fontFamily: 'fonts', | ||
@@ -95,3 +95,3 @@ fontSize: 'fontSizes', | ||
var getMargin = function getMargin(scale, value) { | ||
var positiveOrNegative = function positiveOrNegative(scale, value) { | ||
if (typeof value !== 'number' || value >= 0) { | ||
@@ -107,11 +107,7 @@ return get(scale, value, value); | ||
var transforms = { | ||
margin: getMargin, | ||
marginTop: getMargin, | ||
marginRight: getMargin, | ||
marginBottom: getMargin, | ||
marginLeft: getMargin, | ||
marginX: getMargin, | ||
marginY: getMargin | ||
}; | ||
var transforms = ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'top', 'bottom', 'left', 'right'].reduce(function (acc, curr) { | ||
var _extends2; | ||
return _extends({}, acc, (_extends2 = {}, _extends2[curr] = positiveOrNegative, _extends2)); | ||
}, {}); | ||
export var responsive = function responsive(styles) { | ||
@@ -127,2 +123,3 @@ return function (theme) { | ||
var value = styles[key]; | ||
if (value == null) continue; | ||
@@ -136,2 +133,3 @@ if (!Array.isArray(value)) { | ||
var media = mediaQueries[i]; | ||
if (value[i] == null) continue; | ||
@@ -138,0 +136,0 @@ if (!media) { |
@@ -10,8 +10,4 @@ "use strict"; | ||
var get = function get(obj, key, def, p, undef) { | ||
if (key === void 0) { | ||
key = ''; | ||
} | ||
key = key && key.split ? key.split('.') : [key]; | ||
key = key.split ? key.split('.') : [key]; | ||
for (p = 0; p < key.length; p++) { | ||
@@ -73,2 +69,6 @@ obj = obj ? obj[key[p]] : undef; | ||
paddingY: 'space', | ||
top: 'space', | ||
right: 'space', | ||
bottom: 'space', | ||
left: 'space', | ||
fontFamily: 'fonts', | ||
@@ -102,3 +102,3 @@ fontSize: 'fontSizes', | ||
var getMargin = function getMargin(scale, value) { | ||
var positiveOrNegative = function positiveOrNegative(scale, value) { | ||
if (typeof value !== 'number' || value >= 0) { | ||
@@ -114,12 +114,8 @@ return get(scale, value, value); | ||
var transforms = { | ||
margin: getMargin, | ||
marginTop: getMargin, | ||
marginRight: getMargin, | ||
marginBottom: getMargin, | ||
marginLeft: getMargin, | ||
marginX: getMargin, | ||
marginY: getMargin | ||
}; | ||
var transforms = ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'top', 'bottom', 'left', 'right'].reduce(function (acc, curr) { | ||
var _extends2; | ||
return _extends({}, acc, (_extends2 = {}, _extends2[curr] = positiveOrNegative, _extends2)); | ||
}, {}); | ||
var responsive = function responsive(styles) { | ||
@@ -135,2 +131,3 @@ return function (theme) { | ||
var value = styles[key]; | ||
if (value == null) continue; | ||
@@ -144,2 +141,3 @@ if (!Array.isArray(value)) { | ||
var media = mediaQueries[i]; | ||
if (value[i] == null) continue; | ||
@@ -146,0 +144,0 @@ if (!media) { |
{ | ||
"name": "@styled-system/css", | ||
"version": "5.0.9", | ||
"version": "5.0.10", | ||
"description": "Styled System for the `css` prop", | ||
@@ -18,3 +18,3 @@ "main": "dist/index.js", | ||
"license": "MIT", | ||
"gitHead": "a6feb6009c58f2eb68f0c3120c5672f6cb54294f", | ||
"gitHead": "19b815b2e93f0bea28124299250e3e514f402e4e", | ||
"publishConfig": { | ||
@@ -21,0 +21,0 @@ "access": "public" |
@@ -71,2 +71,6 @@ | ||
`paddingY`, `py` | `space` | ||
`top` | `space` | ||
`bottom` | `space` | ||
`left` | `space` | ||
`right` | `space` | ||
`border` | `borders` | ||
@@ -73,0 +77,0 @@ `borderTop` | `borders` |
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
14339
5
120
344