source: trip-planner-front/node_modules/postcss-merge-longhand/dist/lib/canMerge.js@ b738035

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

primeNG components

  • Property mode set to 100644
File size: 1.1 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8var _isCustomProp = _interopRequireDefault(require("./isCustomProp"));
9
10function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12const important = node => node.important;
13
14const unimportant = node => !node.important;
15/* Cannot be combined with other values in shorthand
16 https://www.w3.org/TR/css-cascade-5/#shorthand */
17
18
19const cssWideKeywords = ['inherit', 'initial', 'unset', 'revert'];
20
21var _default = (props, includeCustomProps = true) => {
22 const uniqueProps = new Set(props.map(node => node.value.toLowerCase()));
23
24 if (uniqueProps.size > 1) {
25 for (const unmergeable of cssWideKeywords) {
26 if (uniqueProps.has(unmergeable)) {
27 return false;
28 }
29 }
30 }
31
32 if (includeCustomProps && props.some(_isCustomProp.default) && !props.every(_isCustomProp.default)) {
33 return false;
34 }
35
36 return props.every(unimportant) || props.every(important);
37};
38
39exports.default = _default;
40module.exports = exports.default;
Note: See TracBrowser for help on using the repository browser.