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

primeNG components

Location:
trip-planner-front/node_modules/postcss-colormin/dist
Files:
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/postcss-colormin/dist/minifyColor.js

    r59329aa re29cc2e  
    66exports.default = minifyColor;
    77
    8 var _color = require("./lib/color");
     8var _colord = require("colord");
    99
    10 var _getShortestString = _interopRequireDefault(require("./lib/getShortestString"));
     10var _names = _interopRequireDefault(require("colord/plugins/names"));
     11
     12var _minify = _interopRequireDefault(require("colord/plugins/minify"));
    1113
    1214function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
    1315
     16(0, _colord.extend)([_names.default, _minify.default]);
    1417/**
    1518 * Performs color value minification
     
    1922 * @param {boolean} options.supportsTransparent – Does the browser support "transparent" value properly
    2023 */
     24
    2125function minifyColor(input, options = {}) {
    2226  const settings = {
     
    2529    ...options
    2630  };
    27   const instance = (0, _color.process)(input);
     31  const instance = (0, _colord.colord)(input);
    2832
    2933  if (instance.isValid()) {
    30     // Try to shorten the string if it is a valid CSS color value.
    31     // Fall back to the original input if it's smaller or has equal length/
    32     return (0, _getShortestString.default)([input.toLowerCase(), instance.toShortString(settings)]);
     34    // Try to shorten the string if it is a valid CSS color value
     35    const minified = instance.minify({
     36      alphaHex: settings.supportsAlphaHex,
     37      transparent: settings.supportsTransparent,
     38      name: true
     39    }); // Fall back to the original input if it's smaller or has equal length
     40
     41    return minified.length < input.length ? minified : input.toLowerCase();
    3342  } else {
    3443    // Possibly malformed, so pass through
Note: See TracChangeset for help on using the changeset viewer.