source: imaps-frontend/node_modules/css-in-js-utils/lib/isUnitlessProperty.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.9 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports["default"] = isUnitlessProperty;
7
8var _hyphenateProperty = require("./hyphenateProperty");
9
10var _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty);
11
12function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
14var 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};
36var prefixedUnitlessProperties = ['animationIterationCount', 'boxFlex', 'boxFlexGroup', 'boxOrdinalGroup', 'columnCount', 'flex', 'flexGrow', 'flexPositive', 'flexShrink', 'flexNegative', 'flexOrder', 'gridColumn', 'gridColumnEnd', 'gridColumnStart', 'gridRow', 'gridRowEnd', 'gridRowStart', 'lineClamp', 'order'];
37var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
38
39function getPrefixedProperty(prefix, property) {
40 return prefix + property.charAt(0).toUpperCase() + property.slice(1);
41} // add all prefixed properties to the unitless properties
42
43
44for (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
54for (var _property in unitlessProperties) {
55 unitlessProperties[(0, _hyphenateProperty2["default"])(_property)] = true;
56}
57
58function isUnitlessProperty(property) {
59 return unitlessProperties.hasOwnProperty(property);
60}
Note: See TracBrowser for help on using the repository browser.