@styled-system/css
Advanced tools
Comparing version 2.0.1 to 2.0.2
15
dist.js
@@ -12,2 +12,4 @@ "use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
@@ -17,4 +19,2 @@ | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
@@ -108,7 +108,2 @@ | ||
if (value && !Array.isArray(value) && _typeof(value) === 'object') { | ||
next[key] = responsive(value)(theme); | ||
continue; | ||
} | ||
if (!Array.isArray(value)) { | ||
@@ -155,2 +150,8 @@ next[key] = value; | ||
if (key === 'variant') { | ||
var variant = css((0, _lodash.default)(theme, val))(theme); | ||
result = _objectSpread({}, result, variant); | ||
continue; | ||
} | ||
if (val && _typeof(val) === 'object') { | ||
@@ -157,0 +158,0 @@ result[prop] = css(val)(theme); |
11
index.js
@@ -84,6 +84,2 @@ import get from 'lodash.get' | ||
const value = styles[key] | ||
if (value && !Array.isArray(value) && typeof value === 'object') { | ||
next[key] = responsive(value)(theme) | ||
continue | ||
} | ||
if (!Array.isArray(value)) { | ||
@@ -109,3 +105,3 @@ next[key] = value | ||
const theme = { ...defaultTheme, ...(props.theme || props) } | ||
const result = {} | ||
let result = {} | ||
const obj = typeof args === 'function' ? args(theme) : args | ||
@@ -120,2 +116,7 @@ const styles = responsive(obj)(theme) | ||
const val = typeof x === 'function' ? x(theme) : x | ||
if (key === 'variant') { | ||
const variant = css(get(theme, val))(theme) | ||
result = { ...result, ...variant } | ||
continue | ||
} | ||
if (val && typeof val === 'object') { | ||
@@ -122,0 +123,0 @@ result[prop] = css(val)(theme) |
{ | ||
"name": "@styled-system/css", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist.js", |
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
12128
273