source: trip-planner-front/node_modules/autoprefixer/lib/hacks/place-self.js@ 8d391a1

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

initial commit

  • Property mode set to 100644
File size: 2.0 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 utils = require('./grid-utils');
12
13var PlaceSelf = /*#__PURE__*/function (_Declaration) {
14 _inheritsLoose(PlaceSelf, _Declaration);
15
16 function PlaceSelf() {
17 return _Declaration.apply(this, arguments) || this;
18 }
19
20 var _proto = PlaceSelf.prototype;
21
22 /**
23 * Translate place-self to separate -ms- prefixed properties
24 */
25 _proto.insert = function insert(decl, prefix, prefixes) {
26 if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); // prevent doubling of prefixes
27
28 if (decl.parent.some(function (i) {
29 return i.prop === '-ms-grid-row-align';
30 })) {
31 return undefined;
32 }
33
34 var _utils$parse = utils.parse(decl),
35 _utils$parse$ = _utils$parse[0],
36 first = _utils$parse$[0],
37 second = _utils$parse$[1];
38
39 if (second) {
40 utils.insertDecl(decl, 'grid-row-align', first);
41 utils.insertDecl(decl, 'grid-column-align', second);
42 } else {
43 utils.insertDecl(decl, 'grid-row-align', first);
44 utils.insertDecl(decl, 'grid-column-align', first);
45 }
46
47 return undefined;
48 };
49
50 return PlaceSelf;
51}(Declaration);
52
53_defineProperty(PlaceSelf, "names", ['place-self']);
54
55module.exports = PlaceSelf;
Note: See TracBrowser for help on using the repository browser.