Skip to content

Commit 223079f

Browse files
authored
Merge pull request #21 from betit/11-download-w3c-data
Download w3c data
2 parents 2c63a9d + 38e9d48 commit 223079f

File tree

5 files changed

+228
-19
lines changed

5 files changed

+228
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ List of standard and browser specific CSS properties.
66

77
## Source
88

9-
1. Standard properties (only 'CR', 'WD', 'FPWD', 'LC', 'REC' statuses): http://www.w3.org/Style/CSS/all-properties.en.json
9+
1. Standard properties (only 'REC', 'CR', 'LC', 'WD', 'FPWD', 'ED' statuses): http://www.w3.org/Style/CSS/all-properties.en.json
1010
2. Browser supported properties from `window.getComputedStyle` / `document.body.style`
1111

1212
### Windows

data/all.json

Lines changed: 75 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"-webkit-background-color",
7373
"-webkit-background-composite",
7474
"background-image",
75+
"background-image-transform",
7576
"-webkit-background-image",
7677
"-moz-background-inline-policy",
7778
"background-origin",
@@ -96,6 +97,11 @@
9697
"-moz-binding",
9798
"-ms-block-progression",
9899
"block-size",
100+
"block-step",
101+
"block-step-align",
102+
"block-step-insert",
103+
"block-step-round",
104+
"block-step-size",
99105
"bookmark-label",
100106
"bookmark-level",
101107
"bookmark-state",
@@ -108,6 +114,8 @@
108114
"-webkit-border-before-style",
109115
"-webkit-border-before",
110116
"-webkit-border-before-width",
117+
"border-block",
118+
"border-block-color",
111119
"border-block-end",
112120
"border-block-end-color",
113121
"border-block-end-style",
@@ -116,6 +124,8 @@
116124
"border-block-start-color",
117125
"border-block-start-style",
118126
"border-block-start-width",
127+
"border-block-style",
128+
"border-block-width",
119129
"border-bottom",
120130
"border-bottom-color",
121131
"-moz-border-bottom-colors",
@@ -149,9 +159,12 @@
149159
"-webkit-border-image-slice",
150160
"border-image-source",
151161
"-webkit-border-image-source",
162+
"border-image-transform",
152163
"-webkit-border-image",
153164
"border-image-width",
154165
"-webkit-border-image-width",
166+
"border-inline",
167+
"border-inline-color",
155168
"border-inline-end",
156169
"border-inline-end-color",
157170
"border-inline-end-style",
@@ -160,6 +173,8 @@
160173
"border-inline-start-color",
161174
"border-inline-start-style",
162175
"border-inline-start-width",
176+
"border-inline-style",
177+
"border-inline-width",
163178
"border-left",
164179
"border-left-color",
165180
"-moz-border-left-colors",
@@ -223,7 +238,6 @@
223238
"-moz-box-sizing",
224239
"-webkit-box-sizing",
225240
"box-snap",
226-
"box-suppress",
227241
"break-after",
228242
"break-before",
229243
"break-inside",
@@ -233,6 +247,7 @@
233247
"caret-animation",
234248
"caret-color",
235249
"caret-shape",
250+
"chains",
236251
"clear",
237252
"clip",
238253
"clip-path",
@@ -292,6 +307,7 @@
292307
"-ms-content-zoom-snap-points",
293308
"-ms-content-zoom-snap-type",
294309
"-ms-content-zooming",
310+
"continue",
295311
"counter-increment",
296312
"counter-reset",
297313
"counter-set",
@@ -313,8 +329,15 @@
313329
"empty-cells",
314330
"enable-background",
315331
"fill",
332+
"fill-break",
333+
"fill-color",
334+
"fill-image",
316335
"fill-opacity",
336+
"fill-origin",
337+
"fill-position",
338+
"fill-repeat",
317339
"fill-rule",
340+
"fill-size",
318341
"filter",
319342
"-ms-filter",
320343
"-webkit-filter",
@@ -356,6 +379,7 @@
356379
"float-reference",
357380
"flood-color",
358381
"flood-opacity",
382+
"flow",
359383
"flow-from",
360384
"-ms-flow-from",
361385
"-webkit-flow-from",
@@ -373,6 +397,11 @@
373397
"-webkit-font-kerning",
374398
"font-language-override",
375399
"-moz-font-language-override",
400+
"font-max-size",
401+
"font-min-size",
402+
"font-optical-sizing",
403+
"font-palette",
404+
"font-presentation",
376405
"font-size",
377406
"font-size-adjust",
378407
"-webkit-font-size-delta",
@@ -466,6 +495,13 @@
466495
"input-format",
467496
"-wap-input-format",
468497
"-wap-input-required",
498+
"inset",
499+
"inset-block",
500+
"inset-block-end",
501+
"inset-block-start",
502+
"inset-inline",
503+
"inset-inline-end",
504+
"inset-inline-start",
469505
"-ms-interpolation-mode",
470506
"isolation",
471507
"justify-content",
@@ -510,13 +546,15 @@
510546
"-webkit-margin-after",
511547
"-webkit-margin-before-collapse",
512548
"-webkit-margin-before",
549+
"margin-block",
513550
"margin-block-end",
514551
"margin-block-start",
515552
"margin-bottom",
516553
"-webkit-margin-bottom-collapse",
517554
"-webkit-margin-collapse",
518555
"-moz-margin-end",
519556
"-webkit-margin-end",
557+
"margin-inline",
520558
"margin-inline-end",
521559
"margin-inline-start",
522560
"margin-left",
@@ -670,11 +708,13 @@
670708
"padding",
671709
"-webkit-padding-after",
672710
"-webkit-padding-before",
711+
"padding-block",
673712
"padding-block-end",
674713
"padding-block-start",
675714
"padding-bottom",
676715
"-moz-padding-end",
677716
"-webkit-padding-end",
717+
"padding-inline",
678718
"padding-inline-end",
679719
"padding-inline-start",
680720
"padding-left",
@@ -709,10 +749,6 @@
709749
"place-self",
710750
"play-during",
711751
"pointer-events",
712-
"polar-anchor",
713-
"polar-angle",
714-
"polar-distance",
715-
"polar-origin",
716752
"position",
717753
"-webkit-print-color-adjust",
718754
"quotes",
@@ -749,20 +785,41 @@
749785
"-ms-scroll-limit-x-min",
750786
"-ms-scroll-limit-y-max",
751787
"-ms-scroll-limit-y-min",
788+
"scroll-padding",
789+
"scroll-padding-block",
790+
"scroll-padding-block-end",
791+
"scroll-padding-block-start",
792+
"scroll-padding-bottom",
793+
"scroll-padding-inline",
794+
"scroll-padding-inline-end",
795+
"scroll-padding-inline-start",
796+
"scroll-padding-left",
797+
"scroll-padding-right",
798+
"scroll-padding-top",
752799
"-ms-scroll-rails",
753800
"scroll-snap-align",
754801
"scroll-snap-coordinate",
755802
"-webkit-scroll-snap-coordinate",
756803
"scroll-snap-destination",
757804
"-webkit-scroll-snap-destination",
758805
"scroll-snap-margin",
759-
"scroll-snap-padding",
806+
"scroll-snap-margin-block",
807+
"scroll-snap-margin-block-end",
808+
"scroll-snap-margin-block-start",
809+
"scroll-snap-margin-bottom",
810+
"scroll-snap-margin-inline",
811+
"scroll-snap-margin-inline-end",
812+
"scroll-snap-margin-inline-start",
813+
"scroll-snap-margin-left",
814+
"scroll-snap-margin-right",
815+
"scroll-snap-margin-top",
760816
"scroll-snap-points-x",
761817
"-ms-scroll-snap-points-x",
762818
"-webkit-scroll-snap-points-x",
763819
"scroll-snap-points-y",
764820
"-ms-scroll-snap-points-y",
765821
"-webkit-scroll-snap-points-y",
822+
"scroll-snap-stop",
766823
"scroll-snap-type",
767824
"-ms-scroll-snap-type",
768825
"-webkit-scroll-snap-type",
@@ -776,6 +833,7 @@
776833
"scrollbar-dark-shadow-color",
777834
"scrollbar-darkshadow-color",
778835
"scrollbar-face-color",
836+
"scrollbar-gutter",
779837
"scrollbar-highlight-color",
780838
"scrollbar-shadow-color",
781839
"scrollbar-track-color",
@@ -808,15 +866,25 @@
808866
"stress",
809867
"string-set",
810868
"stroke",
869+
"stroke-align",
811870
"stroke-alignment",
871+
"stroke-break",
872+
"stroke-color",
873+
"stroke-dash-corner",
874+
"stroke-dash-justify",
812875
"stroke-dashadjust",
813876
"stroke-dasharray",
814877
"stroke-dashcorner",
815878
"stroke-dashoffset",
879+
"stroke-image",
816880
"stroke-linecap",
817881
"stroke-linejoin",
818882
"stroke-miterlimit",
819883
"stroke-opacity",
884+
"stroke-origin",
885+
"stroke-position",
886+
"stroke-repeat",
887+
"stroke-size",
820888
"stroke-width",
821889
"-webkit-svg-shadow",
822890
"tab-size",
@@ -826,6 +894,7 @@
826894
"table-layout",
827895
"-webkit-tap-highlight-color",
828896
"text-align",
897+
"text-align-all",
829898
"text-align-last",
830899
"-moz-text-align-last",
831900
"text-anchor",

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"main": "index.js",
77
"scripts": {
88
"bump": "npm version patch && npm publish && git push && git push --tags",
9-
"generate": "node scripts/generate.js",
9+
"download-w3c-data": "node scripts/download-w3c-data",
10+
"generate": "node scripts/generate",
1011
"lint": "eslint index.js scripts/*.js",
1112
"test": "echo \"Error: no test specified\" && exit 1"
1213
},
@@ -28,6 +29,7 @@
2829
},
2930
"homepage": "https://github.com/betit/known-css-properties#readme",
3031
"devDependencies": {
32+
"axios": "^0.16.2",
3133
"eslint": "^3.19.0",
3234
"globby": "^6.1.0",
3335
"lodash.sortby": "^4.7.0",

scripts/download-w3c-data.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const { writeFile } = require('fs');
2+
const { resolve } = require('path');
3+
const uniq = require('lodash.uniq');
4+
const axios = require('axios');
5+
6+
const outputFile = resolve(__dirname, '../source/w3c.json');
7+
const w3URL = 'https://www.w3.org/Style/CSS/all-properties.en.json';
8+
const validStatuses = ['REC', 'CR', 'LC', 'WD', 'FPWD', 'ED'];
9+
10+
const isEntryValid = ({property, status}) =>
11+
!property.startsWith('--') && validStatuses.includes(status)
12+
13+
const saveData = (properties) =>
14+
new Promise((resolve, reject) => {
15+
writeFile(
16+
outputFile,
17+
JSON.stringify({ properties }, null, 2),
18+
(err, res) => err ? reject(err) : resolve(res)
19+
);
20+
});
21+
22+
axios.get(w3URL)
23+
.then(res => res.data.filter(isEntryValid))
24+
.then(properties => properties.map(({property}) => property))
25+
.then(properties => uniq(properties))
26+
.then(saveData)
27+
.catch(err => console.error(err));

0 commit comments

Comments
 (0)