mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 12:20:04 +02:00
update node modules
This commit is contained in:
25
node_modules/clean-css/lib/optimizer/level-1/value-optimizers/zero.js
generated
vendored
Normal file
25
node_modules/clean-css/lib/optimizer/level-1/value-optimizers/zero.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
var FUNCTION_PATTERN = /^(?:\-moz\-calc|\-webkit\-calc|calc|rgb|hsl|rgba|hsla|min|max|clamp)\(/;
|
||||
|
||||
var plugin = {
|
||||
level1: {
|
||||
value: function zero(name, value, options) {
|
||||
if (!options.compatibility.properties.zeroUnits) {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (FUNCTION_PATTERN.test(value)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (value.indexOf('%') > 0 && (name == 'height' || name == 'max-height' || name == 'width' || name == 'max-width')) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return value
|
||||
.replace(options.unitsRegexp, '$1' + '0' + '$2')
|
||||
.replace(options.unitsRegexp, '$1' + '0' + '$2');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = plugin;
|
Reference in New Issue
Block a user