cssstyle 4.3.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/CSSStyleDeclaration.js +545 -206
- package/lib/allExtraProperties.js +42 -60
- package/lib/allWebkitProperties.js +107 -187
- package/lib/generated/allProperties.js +615 -0
- package/lib/{implementedProperties.js → generated/implementedProperties.js} +11 -18
- package/lib/generated/properties.js +2574 -0
- package/lib/parsers.js +382 -547
- package/lib/properties/background.js +40 -13
- package/lib/properties/backgroundAttachment.js +23 -15
- package/lib/properties/backgroundColor.js +21 -19
- package/lib/properties/backgroundImage.js +19 -14
- package/lib/properties/backgroundPosition.js +35 -41
- package/lib/properties/backgroundRepeat.js +20 -20
- package/lib/properties/border.js +34 -25
- package/lib/properties/borderBottom.js +34 -11
- package/lib/properties/borderBottomColor.js +27 -8
- package/lib/properties/borderBottomStyle.js +42 -13
- package/lib/properties/borderBottomWidth.js +28 -8
- package/lib/properties/borderCollapse.js +16 -16
- package/lib/properties/borderColor.js +32 -18
- package/lib/properties/borderLeft.js +34 -11
- package/lib/properties/borderLeftColor.js +27 -8
- package/lib/properties/borderLeftStyle.js +42 -13
- package/lib/properties/borderLeftWidth.js +28 -8
- package/lib/properties/borderRight.js +34 -11
- package/lib/properties/borderRightColor.js +27 -8
- package/lib/properties/borderRightStyle.js +42 -13
- package/lib/properties/borderRightWidth.js +28 -8
- package/lib/properties/borderSpacing.js +31 -27
- package/lib/properties/borderStyle.js +43 -27
- package/lib/properties/borderTop.js +34 -11
- package/lib/properties/borderTopColor.js +27 -8
- package/lib/properties/borderTopStyle.js +42 -13
- package/lib/properties/borderTopWidth.js +28 -9
- package/lib/properties/borderWidth.js +32 -34
- package/lib/properties/bottom.js +23 -7
- package/lib/properties/clear.js +32 -8
- package/lib/properties/clip.js +33 -27
- package/lib/properties/color.js +23 -7
- package/lib/properties/flex.js +59 -29
- package/lib/properties/flexBasis.js +21 -16
- package/lib/properties/flexGrow.js +19 -10
- package/lib/properties/flexShrink.js +19 -10
- package/lib/properties/float.js +21 -6
- package/lib/properties/floodColor.js +23 -7
- package/lib/properties/font.js +120 -33
- package/lib/properties/fontFamily.js +59 -21
- package/lib/properties/fontSize.js +37 -28
- package/lib/properties/fontStyle.js +23 -9
- package/lib/properties/fontVariant.js +26 -8
- package/lib/properties/fontWeight.js +26 -23
- package/lib/properties/height.js +21 -14
- package/lib/properties/left.js +23 -7
- package/lib/properties/lightingColor.js +23 -7
- package/lib/properties/lineHeight.js +29 -16
- package/lib/properties/margin.js +42 -57
- package/lib/properties/marginBottom.js +34 -7
- package/lib/properties/marginLeft.js +34 -7
- package/lib/properties/marginRight.js +34 -7
- package/lib/properties/marginTop.js +34 -7
- package/lib/properties/opacity.js +39 -7
- package/lib/properties/outlineColor.js +23 -7
- package/lib/properties/padding.js +43 -51
- package/lib/properties/paddingBottom.js +36 -7
- package/lib/properties/paddingLeft.js +34 -7
- package/lib/properties/paddingRight.js +34 -7
- package/lib/properties/paddingTop.js +34 -7
- package/lib/properties/right.js +23 -7
- package/lib/properties/stopColor.js +23 -7
- package/lib/properties/top.js +23 -7
- package/lib/properties/webkitBorderAfterColor.js +23 -7
- package/lib/properties/webkitBorderBeforeColor.js +23 -7
- package/lib/properties/webkitBorderEndColor.js +23 -7
- package/lib/properties/webkitBorderStartColor.js +23 -7
- package/lib/properties/webkitColumnRuleColor.js +23 -7
- package/lib/properties/webkitTapHighlightColor.js +23 -7
- package/lib/properties/webkitTextEmphasisColor.js +23 -7
- package/lib/properties/webkitTextFillColor.js +23 -7
- package/lib/properties/webkitTextStrokeColor.js +23 -7
- package/lib/properties/width.js +21 -14
- package/lib/utils/camelize.js +35 -0
- package/lib/utils/propertyDescriptors.js +16 -0
- package/package.json +5 -4
- package/lib/allProperties.js +0 -529
- package/lib/constants.js +0 -6
- package/lib/named_colors.json +0 -152
- package/lib/properties/azimuth.js +0 -64
- package/lib/properties/cssFloat.js +0 -12
- package/lib/properties/textLineThroughColor.js +0 -14
- package/lib/properties/textOverlineColor.js +0 -14
- package/lib/properties/textUnderlineColor.js +0 -14
- package/lib/properties/webkitMatchNearestMailBlockquoteColor.js +0 -14
- package/lib/properties.js +0 -1672
- package/lib/utils/getBasicPropertyDescriptor.js +0 -14
|
@@ -1,14 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
let num = parsers.parseNumber(v);
|
|
7
|
+
if (num) {
|
|
8
|
+
num = parseFloat(num);
|
|
9
|
+
if (num < 0) {
|
|
10
|
+
return "0";
|
|
11
|
+
} else if (num > 1) {
|
|
12
|
+
return "1";
|
|
13
|
+
}
|
|
14
|
+
return `${num}`;
|
|
15
|
+
}
|
|
16
|
+
let pct = parsers.parsePercent(v);
|
|
17
|
+
if (pct) {
|
|
18
|
+
pct = parseFloat(pct);
|
|
19
|
+
if (pct < 0) {
|
|
20
|
+
return "0%";
|
|
21
|
+
} else if (pct > 100) {
|
|
22
|
+
return "100%";
|
|
23
|
+
}
|
|
24
|
+
return `${pct}%`;
|
|
25
|
+
}
|
|
26
|
+
return parsers.parseKeyword(v);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
module.exports.isValid = function isValid(v) {
|
|
30
|
+
if (v === "") {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
return typeof module.exports.parse(v) === "string";
|
|
34
|
+
};
|
|
4
35
|
|
|
5
36
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
37
|
+
set(v) {
|
|
38
|
+
v = parsers.prepareValue(v, this._global);
|
|
39
|
+
this._setProperty("opacity", module.exports.parse(v));
|
|
8
40
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
41
|
+
get() {
|
|
42
|
+
return this.getPropertyValue("opacity");
|
|
11
43
|
},
|
|
12
44
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
45
|
+
configurable: true
|
|
14
46
|
};
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseColor(v);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "" || typeof parsers.parseKeyword(v) === "string") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return parsers.isValidColor(v);
|
|
18
|
+
};
|
|
4
19
|
|
|
5
20
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
this._setProperty("outline-color", module.exports.parse(v));
|
|
8
24
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
25
|
+
get() {
|
|
26
|
+
return this.getPropertyValue("outline-color");
|
|
11
27
|
},
|
|
12
28
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
29
|
+
configurable: true
|
|
14
30
|
};
|
|
@@ -1,66 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var TYPES = parsers.TYPES;
|
|
3
|
+
const parsers = require("../parsers");
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
var type = parsers.valueType(v);
|
|
8
|
-
return (
|
|
9
|
-
type === TYPES.NULL_OR_EMPTY_STR ||
|
|
10
|
-
type === TYPES.LENGTH ||
|
|
11
|
-
type === TYPES.PERCENT ||
|
|
12
|
-
type === TYPES.CALC ||
|
|
13
|
-
(type === TYPES.INTEGER && (v === '0' || v === 0))
|
|
14
|
-
);
|
|
15
|
-
};
|
|
5
|
+
const positions = ["top", "right", "bottom", "left"];
|
|
16
6
|
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
module.exports.parse = function parse(v) {
|
|
8
|
+
const val = parsers.parseMeasurement(v, true);
|
|
9
|
+
if (val) {
|
|
10
|
+
return val;
|
|
11
|
+
}
|
|
12
|
+
return parsers.parseKeyword(v);
|
|
19
13
|
};
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'padding',
|
|
24
|
-
'',
|
|
25
|
-
function () {
|
|
15
|
+
module.exports.isValid = function isValid(v) {
|
|
16
|
+
if (v === "") {
|
|
26
17
|
return true;
|
|
27
|
-
},
|
|
28
|
-
function (v) {
|
|
29
|
-
return v;
|
|
30
18
|
}
|
|
31
|
-
);
|
|
19
|
+
return typeof module.exports.parse(v) === "string";
|
|
20
|
+
};
|
|
32
21
|
|
|
33
22
|
module.exports.definition = {
|
|
34
|
-
set
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
set(v) {
|
|
24
|
+
v = parsers.prepareValue(v, this._global);
|
|
25
|
+
if (parsers.hasVarFunc(v)) {
|
|
26
|
+
this._implicitSetter(
|
|
27
|
+
"padding",
|
|
28
|
+
"",
|
|
29
|
+
"",
|
|
30
|
+
module.exports.isValid,
|
|
31
|
+
module.exports.parse,
|
|
32
|
+
positions
|
|
33
|
+
);
|
|
34
|
+
this._setProperty("padding", v);
|
|
35
|
+
} else {
|
|
36
|
+
this._implicitSetter(
|
|
37
|
+
"padding",
|
|
38
|
+
"",
|
|
39
|
+
v,
|
|
40
|
+
module.exports.isValid,
|
|
41
|
+
module.exports.parse,
|
|
42
|
+
positions
|
|
43
|
+
);
|
|
40
44
|
}
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
},
|
|
46
|
+
get() {
|
|
47
|
+
const val = this._implicitGetter("padding", positions);
|
|
48
|
+
if (val === "") {
|
|
49
|
+
return this.getPropertyValue("padding");
|
|
43
50
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
case 'inherit':
|
|
47
|
-
case 'initial':
|
|
48
|
-
case 'unset':
|
|
49
|
-
case '':
|
|
50
|
-
myGlobal.call(this, V);
|
|
51
|
-
break;
|
|
52
|
-
|
|
53
|
-
default:
|
|
54
|
-
mySetter.call(this, v);
|
|
55
|
-
break;
|
|
51
|
+
if (parsers.hasVarFunc(val)) {
|
|
52
|
+
return "";
|
|
56
53
|
}
|
|
57
|
-
|
|
58
|
-
get: function () {
|
|
59
|
-
return this.getPropertyValue('padding');
|
|
54
|
+
return val;
|
|
60
55
|
},
|
|
61
56
|
enumerable: true,
|
|
62
|
-
configurable: true
|
|
57
|
+
configurable: true
|
|
63
58
|
};
|
|
64
|
-
|
|
65
|
-
module.exports.isValid = isValid;
|
|
66
|
-
module.exports.parser = parser;
|
|
@@ -1,13 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseMeasurement(v, true);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
5
19
|
|
|
6
20
|
module.exports.definition = {
|
|
7
|
-
set
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
if (parsers.hasVarFunc(v)) {
|
|
24
|
+
this._setProperty("padding", "");
|
|
25
|
+
this._setProperty("padding-bottom", v);
|
|
26
|
+
} else {
|
|
27
|
+
this._subImplicitSetter(
|
|
28
|
+
"padding",
|
|
29
|
+
"bottom",
|
|
30
|
+
v,
|
|
31
|
+
module.exports.isValid,
|
|
32
|
+
module.exports.parse,
|
|
33
|
+
["top", "right", "bottom", "left"]
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
get() {
|
|
38
|
+
return this.getPropertyValue("padding-bottom");
|
|
10
39
|
},
|
|
11
40
|
enumerable: true,
|
|
12
|
-
configurable: true
|
|
41
|
+
configurable: true
|
|
13
42
|
};
|
|
@@ -1,13 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseMeasurement(v, true);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
5
19
|
|
|
6
20
|
module.exports.definition = {
|
|
7
|
-
set
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
if (parsers.hasVarFunc(v)) {
|
|
24
|
+
this._setProperty("padding", "");
|
|
25
|
+
this._setProperty("padding-left", v);
|
|
26
|
+
} else {
|
|
27
|
+
this._subImplicitSetter("padding", "left", v, module.exports.isValid, module.exports.parse, [
|
|
28
|
+
"top",
|
|
29
|
+
"right",
|
|
30
|
+
"bottom",
|
|
31
|
+
"left"
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
get() {
|
|
36
|
+
return this.getPropertyValue("padding-left");
|
|
10
37
|
},
|
|
11
38
|
enumerable: true,
|
|
12
|
-
configurable: true
|
|
39
|
+
configurable: true
|
|
13
40
|
};
|
|
@@ -1,13 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseMeasurement(v, true);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
5
19
|
|
|
6
20
|
module.exports.definition = {
|
|
7
|
-
set
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
if (parsers.hasVarFunc(v)) {
|
|
24
|
+
this._setProperty("padding", "");
|
|
25
|
+
this._setProperty("padding-right", v);
|
|
26
|
+
} else {
|
|
27
|
+
this._subImplicitSetter("padding", "right", v, module.exports.isValid, module.exports.parse, [
|
|
28
|
+
"top",
|
|
29
|
+
"right",
|
|
30
|
+
"bottom",
|
|
31
|
+
"left"
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
get() {
|
|
36
|
+
return this.getPropertyValue("padding-right");
|
|
10
37
|
},
|
|
11
38
|
enumerable: true,
|
|
12
|
-
configurable: true
|
|
39
|
+
configurable: true
|
|
13
40
|
};
|
|
@@ -1,13 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseMeasurement(v, true);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
5
19
|
|
|
6
20
|
module.exports.definition = {
|
|
7
|
-
set
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
if (parsers.hasVarFunc(v)) {
|
|
24
|
+
this._setProperty("padding", "");
|
|
25
|
+
this._setProperty("padding-top", v);
|
|
26
|
+
} else {
|
|
27
|
+
this._subImplicitSetter("padding", "top", v, module.exports.isValid, module.exports.parse, [
|
|
28
|
+
"top",
|
|
29
|
+
"right",
|
|
30
|
+
"bottom",
|
|
31
|
+
"left"
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
get() {
|
|
36
|
+
return this.getPropertyValue("padding-top");
|
|
10
37
|
},
|
|
11
38
|
enumerable: true,
|
|
12
|
-
configurable: true
|
|
39
|
+
configurable: true
|
|
13
40
|
};
|
package/lib/properties/right.js
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const dim = parsers.parseMeasurement(v);
|
|
7
|
+
if (dim) {
|
|
8
|
+
return dim;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v, ["auto"]);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
4
19
|
|
|
5
20
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
this._setProperty("right", module.exports.parse(v));
|
|
8
24
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
25
|
+
get() {
|
|
26
|
+
return this.getPropertyValue("right");
|
|
11
27
|
},
|
|
12
28
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
29
|
+
configurable: true
|
|
14
30
|
};
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseColor(v);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "" || typeof parsers.parseKeyword(v) === "string") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return parsers.isValidColor(v);
|
|
18
|
+
};
|
|
4
19
|
|
|
5
20
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
this._setProperty("stop-color", module.exports.parse(v));
|
|
8
24
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
25
|
+
get() {
|
|
26
|
+
return this.getPropertyValue("stop-color");
|
|
11
27
|
},
|
|
12
28
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
29
|
+
configurable: true
|
|
14
30
|
};
|
package/lib/properties/top.js
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const dim = parsers.parseMeasurement(v);
|
|
7
|
+
if (dim) {
|
|
8
|
+
return dim;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v, ["auto"]);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
4
19
|
|
|
5
20
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
this._setProperty("top", module.exports.parse(v));
|
|
8
24
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
25
|
+
get() {
|
|
26
|
+
return this.getPropertyValue("top");
|
|
11
27
|
},
|
|
12
28
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
29
|
+
configurable: true
|
|
14
30
|
};
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseColor(v);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "" || typeof parsers.parseKeyword(v) === "string") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return parsers.isValidColor(v);
|
|
18
|
+
};
|
|
4
19
|
|
|
5
20
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
this._setProperty("-webkit-border-after-color", module.exports.parse(v));
|
|
8
24
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
25
|
+
get() {
|
|
26
|
+
return this.getPropertyValue("-webkit-border-after-color");
|
|
11
27
|
},
|
|
12
28
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
29
|
+
configurable: true
|
|
14
30
|
};
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseColor(v);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "" || typeof parsers.parseKeyword(v) === "string") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return parsers.isValidColor(v);
|
|
18
|
+
};
|
|
4
19
|
|
|
5
20
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
this._setProperty("-webkit-border-before-color", module.exports.parse(v));
|
|
8
24
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
25
|
+
get() {
|
|
26
|
+
return this.getPropertyValue("-webkit-border-before-color");
|
|
11
27
|
},
|
|
12
28
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
29
|
+
configurable: true
|
|
14
30
|
};
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseColor(v);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "" || typeof parsers.parseKeyword(v) === "string") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return parsers.isValidColor(v);
|
|
18
|
+
};
|
|
4
19
|
|
|
5
20
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
this._setProperty("-webkit-border-end-color", module.exports.parse(v));
|
|
8
24
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
25
|
+
get() {
|
|
26
|
+
return this.getPropertyValue("-webkit-border-end-color");
|
|
11
27
|
},
|
|
12
28
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
29
|
+
configurable: true
|
|
14
30
|
};
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseColor(v);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "" || typeof parsers.parseKeyword(v) === "string") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return parsers.isValidColor(v);
|
|
18
|
+
};
|
|
4
19
|
|
|
5
20
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
this._setProperty("-webkit-border-start-color", module.exports.parse(v));
|
|
8
24
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
25
|
+
get() {
|
|
26
|
+
return this.getPropertyValue("-webkit-border-start-color");
|
|
11
27
|
},
|
|
12
28
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
29
|
+
configurable: true
|
|
14
30
|
};
|