fela-plugin-fallback-value
Advanced tools
Comparing version 1.0.0-beta.1 to 1.0.0-beta.2
@@ -14,26 +14,2 @@ (function (global, factory) { | ||
babelHelpers.classCallCheck = function (instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
}; | ||
babelHelpers.createClass = function () { | ||
function defineProperties(target, props) { | ||
for (var i = 0; i < props.length; i++) { | ||
var descriptor = props[i]; | ||
descriptor.enumerable = descriptor.enumerable || false; | ||
descriptor.configurable = true; | ||
if ("value" in descriptor) descriptor.writable = true; | ||
Object.defineProperty(target, descriptor.key, descriptor); | ||
} | ||
} | ||
return function (Constructor, protoProps, staticProps) { | ||
if (protoProps) defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) defineProperties(Constructor, staticProps); | ||
return Constructor; | ||
}; | ||
}(); | ||
babelHelpers.extends = Object.assign || function (target) { | ||
@@ -73,26 +49,22 @@ for (var i = 1; i < arguments.length; i++) { | ||
function fallbackValue() { | ||
return function (pluginInterface) { | ||
var style = pluginInterface.style; | ||
var processStyle = pluginInterface.processStyle; | ||
function fallbackValue(style) { | ||
Object.keys(style).forEach(function (property) { | ||
var value = style[property]; | ||
if (Array.isArray(value)) { | ||
style[property] = value.join(';' + hypenateStyleName(property) + ':'); | ||
} else if (value instanceof Object) { | ||
style[property] = fallbackValue(value); | ||
} | ||
}); | ||
return style; | ||
} | ||
Object.keys(style).forEach(function (property) { | ||
var value = style[property]; | ||
if (Array.isArray(value)) { | ||
style[property] = value.join(';' + hypenateStyleName(property) + ':'); | ||
} else if (value instanceof Object) { | ||
style[property] = processStyle(babelHelpers.extends({}, pluginInterface, { | ||
style: value | ||
})); | ||
} | ||
}); | ||
var fallbackValue$1 = (function () { | ||
return fallbackValue; | ||
}) | ||
return style; | ||
}; | ||
} | ||
return fallbackValue$1; | ||
return fallbackValue; | ||
})); | ||
//# sourceMappingURL=fela-plugin-fallback-value.js.map |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.FelaPluginFallbackValue=t()}(this,function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}function t(){return function(e){var t=e.style,o=e.processStyle;return Object.keys(t).forEach(function(a){var f=t[a];Array.isArray(f)?t[a]=f.join(";"+r(a)+":"):f instanceof Object&&(t[a]=o(n["extends"]({},e,{style:f})))}),t}}var n={};n["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},n.classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},n.createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),n["extends"]=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};var o=e(function(e){function t(e){return e.replace(n,"-$&").toLowerCase().replace(o,"-ms-")}var n=/[A-Z]/g,o=/^ms-/;e.exports=t}),r=o&&"object"==typeof o&&"default"in o?o["default"]:o;return t}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.FelaPluginFallbackValue=e()}(this,function(){"use strict";function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}function e(t){return Object.keys(t).forEach(function(o){var n=t[o];Array.isArray(n)?t[o]=n.join(";"+r(o)+":"):n instanceof Object&&(t[o]=e(n))}),t}var o={};o["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o["extends"]=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t};var n=t(function(t){function e(t){return t.replace(o,"-$&").toLowerCase().replace(n,"-ms-")}var o=/[A-Z]/g,n=/^ms-/;t.exports=e}),r=n&&"object"==typeof n&&"default"in n?n["default"]:n,f=function(){return e};return f}); |
{ | ||
"name": "fela-plugin-fallback-value", | ||
"version": "1.0.0-beta.1", | ||
"version": "1.0.0-beta.2", | ||
"description": "Fela plugin to resolve fallback values", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,4 +0,22 @@ | ||
# Fallback value plugin for Fela | ||
# fela-plugin-fallback-value | ||
Plugin that resolves fallback values passed as an array. | ||
Check out the [Fela repository](https://github.com/rofrischmann/fela) for further information. | ||
Sometimes you want to provide alternative values also know as *fallback values*. <br> | ||
For example in Internet Explorer 8 there is no `rgba` compatibility for colors which means just passing *e.g. `color: rgba(0, 0, 0, 0.5)`* would not be applied correctly. | ||
By passing an array of values you may provide fallback values. | ||
```javascript | ||
{ | ||
box: { | ||
color: [ 'rgba(0, 0, 0, 0.5)', '#ccc'] | ||
// This would outputcolor | ||
// color: 'rgba(0, 0, 0, 0.5);color:#ccc' | ||
} | ||
} | ||
``` | ||
which is similar to the following CSS code: | ||
```CSS | ||
.box { | ||
color: rgba(0, 0, 0, 0.5); | ||
color: #ccc | ||
} | ||
``` |
Sorry, the diff of this file is not supported yet
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
23
6883
51