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
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.default = gradient;
|
---|
| 7 |
|
---|
| 8 | var _isPrefixedValue = require('css-in-js-utils/lib/isPrefixedValue');
|
---|
| 9 |
|
---|
| 10 | var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);
|
---|
| 11 |
|
---|
| 12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
| 13 |
|
---|
| 14 | var prefixes = ['-webkit-', '-moz-', ''];
|
---|
| 15 | var values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi;
|
---|
| 16 |
|
---|
| 17 | function 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.