source: trip-planner-front/node_modules/autoprefixer/lib/hacks/grid-end.js@ e29cc2e

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

initial commit

  • Property mode set to 100644
File size: 2.1 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 Declaration = require('../declaration');
10
11var GridEnd = /*#__PURE__*/function (_Declaration) {
12 _inheritsLoose(GridEnd, _Declaration);
13
14 function GridEnd() {
15 return _Declaration.apply(this, arguments) || this;
16 }
17
18 var _proto = GridEnd.prototype;
19
20 /**
21 * Change repeating syntax for IE
22 */
23 _proto.insert = function insert(decl, prefix, prefixes, result) {
24 if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
25 var clonedDecl = this.clone(decl);
26 var startProp = decl.prop.replace(/end$/, 'start');
27 var spanProp = prefix + decl.prop.replace(/end$/, 'span');
28
29 if (decl.parent.some(function (i) {
30 return i.prop === spanProp;
31 })) {
32 return undefined;
33 }
34
35 clonedDecl.prop = spanProp;
36
37 if (decl.value.includes('span')) {
38 clonedDecl.value = decl.value.replace(/span\s/i, '');
39 } else {
40 var startDecl;
41 decl.parent.walkDecls(startProp, function (d) {
42 startDecl = d;
43 });
44
45 if (startDecl) {
46 var value = Number(decl.value) - Number(startDecl.value) + '';
47 clonedDecl.value = value;
48 } else {
49 decl.warn(result, "Can not prefix " + decl.prop + " (" + startProp + " is not found)");
50 }
51 }
52
53 decl.cloneBefore(clonedDecl);
54 return undefined;
55 };
56
57 return GridEnd;
58}(Declaration);
59
60_defineProperty(GridEnd, "names", ['grid-row-end', 'grid-column-end']);
61
62module.exports = GridEnd;
Note: See TracBrowser for help on using the repository browser.