source: trip-planner-front/node_modules/autoprefixer/lib/hacks/cross-fade.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.8 KB
Line 
1"use strict";
2
3function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
4
5function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
6
7function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
9var list = require('postcss').list;
10
11var Value = require('../value');
12
13var CrossFade = /*#__PURE__*/function (_Value) {
14 _inheritsLoose(CrossFade, _Value);
15
16 function CrossFade() {
17 return _Value.apply(this, arguments) || this;
18 }
19
20 var _proto = CrossFade.prototype;
21
22 _proto.replace = function replace(string, prefix) {
23 var _this = this;
24
25 return list.space(string).map(function (value) {
26 if (value.slice(0, +_this.name.length + 1) !== _this.name + '(') {
27 return value;
28 }
29
30 var close = value.lastIndexOf(')');
31 var after = value.slice(close + 1);
32 var args = value.slice(_this.name.length + 1, close);
33
34 if (prefix === '-webkit-') {
35 var match = args.match(/\d*.?\d+%?/);
36
37 if (match) {
38 args = args.slice(match[0].length).trim();
39 args += ", " + match[0];
40 } else {
41 args += ', 0.5';
42 }
43 }
44
45 return prefix + _this.name + '(' + args + ')' + after;
46 }).join(' ');
47 };
48
49 return CrossFade;
50}(Value);
51
52_defineProperty(CrossFade, "names", ['cross-fade']);
53
54module.exports = CrossFade;
Note: See TracBrowser for help on using the repository browser.