source: trip-planner-front/node_modules/autoprefixer/lib/hacks/break-props.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: 2.4 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 BreakProps = /*#__PURE__*/function (_Declaration) {
12 _inheritsLoose(BreakProps, _Declaration);
13
14 function BreakProps() {
15 return _Declaration.apply(this, arguments) || this;
16 }
17
18 var _proto = BreakProps.prototype;
19
20 /**
21 * Change name for -webkit- and -moz- prefix
22 */
23 _proto.prefixed = function prefixed(prop, prefix) {
24 return prefix + "column-" + prop;
25 }
26 /**
27 * Return property name by final spec
28 */
29 ;
30
31 _proto.normalize = function normalize(prop) {
32 if (prop.includes('inside')) {
33 return 'break-inside';
34 }
35
36 if (prop.includes('before')) {
37 return 'break-before';
38 }
39
40 return 'break-after';
41 }
42 /**
43 * Change prefixed value for avoid-column and avoid-page
44 */
45 ;
46
47 _proto.set = function set(decl, prefix) {
48 if (decl.prop === 'break-inside' && decl.value === 'avoid-column' || decl.value === 'avoid-page') {
49 decl.value = 'avoid';
50 }
51
52 return _Declaration.prototype.set.call(this, decl, prefix);
53 }
54 /**
55 * Don’t prefix some values
56 */
57 ;
58
59 _proto.insert = function insert(decl, prefix, prefixes) {
60 if (decl.prop !== 'break-inside') {
61 return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
62 }
63
64 if (/region/i.test(decl.value) || /page/i.test(decl.value)) {
65 return undefined;
66 }
67
68 return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
69 };
70
71 return BreakProps;
72}(Declaration);
73
74_defineProperty(BreakProps, "names", ['break-inside', 'page-break-inside', 'column-break-inside', 'break-before', 'page-break-before', 'column-break-before', 'break-after', 'page-break-after', 'column-break-after']);
75
76module.exports = BreakProps;
Note: See TracBrowser for help on using the repository browser.