-
Notifications
You must be signed in to change notification settings - Fork 509
/
CSSAnimatedProperties.ejs
40 lines (33 loc) · 1.06 KB
/
CSSAnimatedProperties.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<%
/*
Searches all CSS properties in CSSData that are animated and lists them
in columns
*/
// Throw a MacroDeprecatedError flaw
// Condition for removal: no more use in translated-content
// 0 occurrences left in en-US
mdn.deprecated();
// Read all CSSData and extract animated properties
const data = require('mdn-data/css');
var animatedProps = [];
// Go through all properties, and test if they are animated. If so, add them to
// the animatedProps array.
for (var property in data.properties) {
if (Object.prototype.hasOwnProperty.call(data.properties, property)) {
if (!["discrete", "notAnimatable"].includes(data.properties[property].animationType)) {
animatedProps.push(property);
}
}
}
animatedProps.sort();
// Build the output string
var result = "<div class=\"index\">\n <ul>\n";
for (var propIndex in animatedProps) {
var prop = animatedProps[propIndex];
if (result) {
result += " ";
}
result += " <li>" + await template("cssxref", [prop]) + "</li>\n";
}
result += " </ul>\n</div>";
%><%- result %>