fela-plugin-extend
Advanced tools
Comparing version 5.0.12 to 6.0.0
import { isObject, arrayEach, objectEach } from 'fela-utils'; | ||
import assignStyle from 'css-in-js-utils/lib/assignStyle'; | ||
function extendStyle(style, extension, extendPlugin, type, renderer) { | ||
var merge = renderer._mergeStyle || assignStyle; | ||
function extendStyle(style, extension, extendPlugin, renderer) { | ||
// extend conditional style objects | ||
if (extension.hasOwnProperty('condition')) { | ||
if (extension.condition) { | ||
merge(style, extendPlugin(extension.style, type, renderer)); | ||
renderer._mergeStyle(style, extendPlugin(extension.style)); | ||
} | ||
} else { | ||
// extend basic style objects | ||
merge(style, extension); | ||
renderer._mergeStyle(style, extension); | ||
} | ||
@@ -24,3 +21,3 @@ } | ||
arrayEach(extensions, function (extension) { | ||
return extendStyle(style, extension, extend, type, renderer); | ||
return extendStyle(style, extension, extend, renderer); | ||
}); | ||
@@ -27,0 +24,0 @@ delete style[property]; |
@@ -9,22 +9,15 @@ 'use strict'; | ||
var _assignStyle = require('css-in-js-utils/lib/assignStyle'); | ||
var _assignStyle2 = _interopRequireDefault(_assignStyle); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function extendStyle(style, extension, extendPlugin, type, renderer) { | ||
var merge = renderer._mergeStyle || _assignStyle2.default; | ||
function extendStyle(style, extension, extendPlugin, renderer) { | ||
// extend conditional style objects | ||
if (extension.hasOwnProperty('condition')) { | ||
if (extension.condition) { | ||
merge(style, extendPlugin(extension.style, type, renderer)); | ||
renderer._mergeStyle(style, extendPlugin(extension.style)); | ||
} | ||
} else { | ||
// extend basic style objects | ||
merge(style, extension); | ||
renderer._mergeStyle(style, extension); | ||
} | ||
} | ||
function extend(style, type, renderer) { | ||
@@ -36,3 +29,3 @@ (0, _felaUtils.objectEach)(style, function (value, property) { | ||
(0, _felaUtils.arrayEach)(extensions, function (extension) { | ||
return extendStyle(style, extension, extend, type, renderer); | ||
return extendStyle(style, extension, extend, renderer); | ||
}); | ||
@@ -39,0 +32,0 @@ delete style[property]; |
{ | ||
"name": "fela-plugin-extend", | ||
"version": "5.0.12", | ||
"version": "6.0.0", | ||
"description": "Fela plugin to extend style objects", | ||
@@ -22,2 +22,5 @@ "main": "lib/index.js", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"fela": "^6.0.0" | ||
}, | ||
"dependencies": { | ||
@@ -24,0 +27,0 @@ "css-in-js-utils": "2.0.0", |
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
5769
3
62