source: imaps-frontend/node_modules/inline-style-prefixer/lib/plugins/gradient.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 776 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = gradient;
7
8var _isPrefixedValue = require('css-in-js-utils/lib/isPrefixedValue');
9
10var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);
11
12function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
14var prefixes = ['-webkit-', '-moz-', ''];
15var values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi;
16
17function gradient(property, value) {
18 if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && values.test(value)) {
19 return prefixes.map(function (prefix) {
20 return value.replace(values, function (grad) {
21 return prefix + grad;
22 });
23 });
24 }
25}
Note: See TracBrowser for help on using the repository browser.