[d565449] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports["default"] = isUnitlessProperty;
|
---|
| 7 |
|
---|
| 8 | var _hyphenateProperty = require("./hyphenateProperty");
|
---|
| 9 |
|
---|
| 10 | var _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty);
|
---|
| 11 |
|
---|
| 12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
---|
| 13 |
|
---|
| 14 | var unitlessProperties = {
|
---|
| 15 | borderImageOutset: true,
|
---|
| 16 | borderImageSlice: true,
|
---|
| 17 | borderImageWidth: true,
|
---|
| 18 | fontWeight: true,
|
---|
| 19 | lineHeight: true,
|
---|
| 20 | opacity: true,
|
---|
| 21 | orphans: true,
|
---|
| 22 | tabSize: true,
|
---|
| 23 | widows: true,
|
---|
| 24 | zIndex: true,
|
---|
| 25 | zoom: true,
|
---|
| 26 | // SVG-related properties
|
---|
| 27 | fillOpacity: true,
|
---|
| 28 | floodOpacity: true,
|
---|
| 29 | stopOpacity: true,
|
---|
| 30 | strokeDasharray: true,
|
---|
| 31 | strokeDashoffset: true,
|
---|
| 32 | strokeMiterlimit: true,
|
---|
| 33 | strokeOpacity: true,
|
---|
| 34 | strokeWidth: true
|
---|
| 35 | };
|
---|
| 36 | var prefixedUnitlessProperties = ['animationIterationCount', 'boxFlex', 'boxFlexGroup', 'boxOrdinalGroup', 'columnCount', 'flex', 'flexGrow', 'flexPositive', 'flexShrink', 'flexNegative', 'flexOrder', 'gridColumn', 'gridColumnEnd', 'gridColumnStart', 'gridRow', 'gridRowEnd', 'gridRowStart', 'lineClamp', 'order'];
|
---|
| 37 | var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
---|
| 38 |
|
---|
| 39 | function getPrefixedProperty(prefix, property) {
|
---|
| 40 | return prefix + property.charAt(0).toUpperCase() + property.slice(1);
|
---|
| 41 | } // add all prefixed properties to the unitless properties
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 | for (var i = 0, len = prefixedUnitlessProperties.length; i < len; ++i) {
|
---|
| 45 | var property = prefixedUnitlessProperties[i];
|
---|
| 46 | unitlessProperties[property] = true;
|
---|
| 47 |
|
---|
| 48 | for (var j = 0, jLen = prefixes.length; j < jLen; ++j) {
|
---|
| 49 | unitlessProperties[getPrefixedProperty(prefixes[j], property)] = true;
|
---|
| 50 | }
|
---|
| 51 | } // add all hypenated properties as well
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | for (var _property in unitlessProperties) {
|
---|
| 55 | unitlessProperties[(0, _hyphenateProperty2["default"])(_property)] = true;
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | function isUnitlessProperty(property) {
|
---|
| 59 | return unitlessProperties.hasOwnProperty(property);
|
---|
| 60 | } |
---|