GT2/Ejectable/node_modules/inline-style-prefixer/es/plugins/gradient.js

14 lines
499 B
JavaScript
Raw Normal View History

2021-08-16 00:14:59 +00:00
import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';
var prefixes = ['-webkit-', '-moz-', ''];
var values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi;
export default function gradient(property, value) {
if (typeof value === 'string' && !isPrefixedValue(value) && values.test(value)) {
return prefixes.map(function (prefix) {
return value.replace(values, function (grad) {
return prefix + grad;
});
});
}
}