summaryrefslogtreecommitdiff
path: root/node_modules/clean-css/lib/optimizer/level-1/value-optimizers/unit.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:10:59 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:41:44 +0800
commitfc87c009806dcc98867f6b58efe29b042aa01dee (patch)
tree8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/clean-css/lib/optimizer/level-1/value-optimizers/unit.js
parent3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff)
node: updatemain
Diffstat (limited to 'node_modules/clean-css/lib/optimizer/level-1/value-optimizers/unit.js')
-rw-r--r--node_modules/clean-css/lib/optimizer/level-1/value-optimizers/unit.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/node_modules/clean-css/lib/optimizer/level-1/value-optimizers/unit.js b/node_modules/clean-css/lib/optimizer/level-1/value-optimizers/unit.js
deleted file mode 100644
index df2cda59..00000000
--- a/node_modules/clean-css/lib/optimizer/level-1/value-optimizers/unit.js
+++ /dev/null
@@ -1,46 +0,0 @@
-var WHOLE_PIXEL_VALUE = /(?:^|\s|\()(-?\d+)px/;
-
-var plugin = {
- level1: {
- value: function unit(_name, value, options) {
- if (!WHOLE_PIXEL_VALUE.test(value)) {
- return value;
- }
-
- return value.replace(WHOLE_PIXEL_VALUE, function(match, val) {
- var newValue;
- var intVal = parseInt(val);
-
- if (intVal === 0) {
- return match;
- }
-
- if (options.compatibility.properties.shorterLengthUnits
- && options.compatibility.units.pt
- && intVal * 3 % 4 === 0) {
- newValue = intVal * 3 / 4 + 'pt';
- }
-
- if (options.compatibility.properties.shorterLengthUnits
- && options.compatibility.units.pc
- && intVal % 16 === 0) {
- newValue = intVal / 16 + 'pc';
- }
-
- if (options.compatibility.properties.shorterLengthUnits
- && options.compatibility.units.in
- && intVal % 96 === 0) {
- newValue = intVal / 96 + 'in';
- }
-
- if (newValue) {
- newValue = match.substring(0, match.indexOf(val)) + newValue;
- }
-
- return newValue && newValue.length < match.length ? newValue : match;
- });
- }
- }
-};
-
-module.exports = plugin;