1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = appendPxIfNeeded;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | var isUnitlessNumber = {
|
13 | animationIterationCount: true,
|
14 | boxFlex: true,
|
15 | boxFlexGroup: true,
|
16 | boxOrdinalGroup: true,
|
17 | columnCount: true,
|
18 | flex: true,
|
19 | flexGrow: true,
|
20 | flexPositive: true,
|
21 | flexShrink: true,
|
22 | flexNegative: true,
|
23 | flexOrder: true,
|
24 | gridRow: true,
|
25 | gridColumn: true,
|
26 | fontWeight: true,
|
27 | lineClamp: true,
|
28 | lineHeight: true,
|
29 | opacity: true,
|
30 | order: true,
|
31 | orphans: true,
|
32 | tabSize: true,
|
33 | widows: true,
|
34 | zIndex: true,
|
35 | zoom: true,
|
36 |
|
37 |
|
38 | fillOpacity: true,
|
39 | stopOpacity: true,
|
40 | strokeDashoffset: true,
|
41 | strokeOpacity: true,
|
42 | strokeWidth: true
|
43 | };
|
44 |
|
45 | function appendPxIfNeeded(propertyName, value) {
|
46 | var needsPxSuffix = !isUnitlessNumber[propertyName] && typeof value === 'number' && value !== 0;
|
47 | return needsPxSuffix ? value + 'px' : value;
|
48 | }
|
49 | module.exports = exports['default']; |
\ | No newline at end of file |