@asamuzakjp/css-color
Advanced tools
Comparing version 2.6.5 to 2.6.6
@@ -54,3 +54,3 @@ { | ||
}, | ||
"version": "2.6.5" | ||
"version": "2.6.6" | ||
} |
@@ -45,3 +45,3 @@ /** | ||
const { unit, value: relativeValue } = detail; | ||
const { dimension = {}, format } = opt; | ||
const { dimension = {} } = opt; | ||
if (unit === 'px') { | ||
@@ -57,3 +57,3 @@ return value; | ||
pixelValue = dimension.callback(unit); | ||
} else if (/^(?:ch|ex|lh)$/.test(unit) && | ||
} else if (/^(?:ch|lh)$/.test(unit) && | ||
Object.hasOwnProperty.call(dimension, 'em')) { | ||
@@ -66,3 +66,3 @@ const { em } = dimension; | ||
} | ||
} else if (/^(?:rch|rex|rlh)$/.test(unit) && | ||
} else if (/^(?:rch|rlh)$/.test(unit) && | ||
Object.hasOwnProperty.call(dimension, 'rem')) { | ||
@@ -75,22 +75,2 @@ const { rem } = dimension; | ||
} | ||
} else if (format === VAL_SPEC) { | ||
const lengthInPx = { | ||
ch: 8, | ||
cm: 96 / 2.54, | ||
em: 16, | ||
ex: 8, | ||
in: 96, | ||
lh: 1.2 * 16, | ||
mm: 96 / 2.54 / 10, | ||
pc: 16, | ||
pt: 16 / 12, | ||
q: 96 / 2.54 / 40, | ||
rch: 8, | ||
rem: 16, | ||
rex: 8, | ||
rlh: 1.2 * 16 | ||
}; | ||
if (Object.hasOwnProperty.call(lengthInPx, unit)) { | ||
pixelValue = lengthInPx[unit]; | ||
} | ||
} | ||
@@ -97,0 +77,0 @@ if (Number.isFinite(pixelValue)) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1347776
5801
15