Ignore:
Timestamp:
11/25/21 22:08:24 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
8d391a1
Parents:
59329aa
Message:

primeNG components

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/postcss-convert-values/dist/index.js

    r59329aa re29cc2e  
    1616function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
    1717
    18 const LENGTH_UNITS = ['em', 'ex', 'ch', 'rem', 'vw', 'vh', 'vmin', 'vmax', 'cm', 'mm', 'q', 'in', 'pt', 'pc', 'px'];
     18const LENGTH_UNITS = ['em', 'ex', 'ch', 'rem', 'vw', 'vh', 'vmin', 'vmax', 'cm', 'mm', 'q', 'in', 'pt', 'pc', 'px']; // These properties only accept percentages, so no point in trying to transform
     19
     20const notALength = new Set(['descent-override', 'ascent-override', 'font-stretch', 'size-adjust', 'line-gap-override']); // Can't change the unit on these properties when they're 0
     21
     22const keepWhenZero = new Set(['stroke-dashoffset', 'stroke-width', 'line-height']);
    1923/*
    2024 * Numbers without digits after the dot are technically invalid,
     
    6771}
    6872
    69 function shouldKeepUnit(decl) {
     73function shouldKeepZeroUnit(decl) {
    7074  const {
    7175    parent
    7276  } = decl;
    7377  const lowerCasedProp = decl.prop.toLowerCase();
    74   return ~decl.value.indexOf('%') && (lowerCasedProp === 'max-height' || lowerCasedProp === 'height') || parent.parent && parent.parent.name && parent.parent.name.toLowerCase() === 'keyframes' && lowerCasedProp === 'stroke-dasharray' || lowerCasedProp === 'stroke-dashoffset' || lowerCasedProp === 'stroke-width' || lowerCasedProp === 'line-height';
     78  return ~decl.value.indexOf('%') && (lowerCasedProp === 'max-height' || lowerCasedProp === 'height') || parent.parent && parent.parent.name && parent.parent.name.toLowerCase() === 'keyframes' && lowerCasedProp === 'stroke-dasharray' || keepWhenZero.has(lowerCasedProp);
    7579}
    7680
     
    7882  const lowerCasedProp = decl.prop.toLowerCase();
    7983
    80   if (~lowerCasedProp.indexOf('flex') || lowerCasedProp.indexOf('--') === 0) {
     84  if (~lowerCasedProp.indexOf('flex') || lowerCasedProp.indexOf('--') === 0 || notALength.has(lowerCasedProp)) {
    8185    return;
    8286  }
     
    8690
    8791    if (node.type === 'word') {
    88       parseWord(node, opts, shouldKeepUnit(decl));
     92      parseWord(node, opts, shouldKeepZeroUnit(decl));
    8993
    9094      if (lowerCasedProp === 'opacity' || lowerCasedProp === 'shape-image-threshold') {
Note: See TracChangeset for help on using the changeset viewer.