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

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

primeNG components

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[6a3a178]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;
[e29cc2e]15/* Cannot be combined with other values in shorthand
16 https://www.w3.org/TR/css-cascade-5/#shorthand */
[6a3a178]17
18
[e29cc2e]19const cssWideKeywords = ['inherit', 'initial', 'unset', 'revert'];
[6a3a178]20
21var _default = (props, includeCustomProps = true) => {
[e29cc2e]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 }
[6a3a178]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.