postcss-reduce-initial 8.0.1 → 8.0.2
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/LICENSE-MIT +1 -1
- package/README.md +1 -1
- package/package.json +28 -9
- package/src/data/fromInitial.json +95 -19
- package/src/data/toInitial.json +7 -2
- package/src/index.js +21 -14
- package/src/lib/computeBrowsersToSupport.js +27 -0
- package/src/lib/getBrowsersForWebBuild.js +35 -0
- package/types/index.d.ts +6 -20
- package/types/index.d.ts.map +1 -1
- package/types/lib/computeBrowsersToSupport.d.ts +18 -0
- package/types/lib/computeBrowsersToSupport.d.ts.map +1 -0
- package/types/lib/getBrowsersForWebBuild.d.ts +3 -0
- package/types/lib/getBrowsersForWebBuild.d.ts.map +1 -0
package/LICENSE-MIT
CHANGED
package/README.md
CHANGED
|
@@ -87,6 +87,6 @@ See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTOR
|
|
|
87
87
|
|
|
88
88
|
This program uses a list of CSS properties derived from data maintained my the MDN team at Mozilla and licensed under the [CC0 1.0 Universal Public Domain Dedication](https://creativecommons.org/publicdomain/zero/1.0/).
|
|
89
89
|
|
|
90
|
-
MIT © [Ben Briggs](
|
|
90
|
+
MIT © [Ben Briggs](https://beneb.info)
|
|
91
91
|
|
|
92
92
|
[postcss]: https://github.com/postcss/postcss
|
package/package.json
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-reduce-initial",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"description": "Reduce initial definitions to the actual initial value, where possible.",
|
|
5
|
-
"
|
|
6
|
-
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./types/index.d.ts",
|
|
8
|
+
"default": "./src/index.js"
|
|
9
|
+
},
|
|
10
|
+
"./src": "./src/index.js",
|
|
11
|
+
"./src/index": "./src/index.js",
|
|
12
|
+
"./src/index.js": "./src/index.js",
|
|
13
|
+
"./src/lib/ignoreProps": "./src/lib/ignoreProps.js",
|
|
14
|
+
"./src/lib/ignoreProps.js": "./src/lib/ignoreProps.js",
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"imports": {
|
|
18
|
+
"#getBrowsersList": {
|
|
19
|
+
"node": "./src/lib/computeBrowsersToSupport.js",
|
|
20
|
+
"default": "./src/lib/getBrowsersForWebBuild.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
7
23
|
"files": [
|
|
8
24
|
"src",
|
|
9
25
|
"LICENSE-MIT",
|
|
@@ -19,11 +35,14 @@
|
|
|
19
35
|
"author": {
|
|
20
36
|
"name": "Ben Briggs",
|
|
21
37
|
"email": "beneb.info@gmail.com",
|
|
22
|
-
"url": "
|
|
38
|
+
"url": "https://beneb.info"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "cssnano/cssnano"
|
|
23
43
|
},
|
|
24
|
-
"repository": "cssnano/cssnano",
|
|
25
44
|
"dependencies": {
|
|
26
|
-
"browserslist": "^4.28.
|
|
45
|
+
"browserslist": "^4.28.7",
|
|
27
46
|
"caniuse-api": "^4.0.0"
|
|
28
47
|
},
|
|
29
48
|
"bugs": {
|
|
@@ -33,11 +52,11 @@
|
|
|
33
52
|
"node": "^22.11.0 || ^24.11.0 || >=26.0"
|
|
34
53
|
},
|
|
35
54
|
"devDependencies": {
|
|
36
|
-
"
|
|
37
|
-
"postcss": "^8.5.
|
|
55
|
+
"mdn-data": "^2.29.0",
|
|
56
|
+
"postcss": "^8.5.25"
|
|
38
57
|
},
|
|
39
58
|
"peerDependencies": {
|
|
40
|
-
"postcss": "^8.5.
|
|
59
|
+
"postcss": "^8.5.25"
|
|
41
60
|
},
|
|
42
61
|
"scripts": {
|
|
43
62
|
"acquire": "node ./src/script/acquire.mjs"
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
+
"-webkit-text-stroke-width": "0",
|
|
2
3
|
"accent-color": "auto",
|
|
3
4
|
"align-content": "normal",
|
|
4
5
|
"align-items": "normal",
|
|
5
6
|
"align-self": "auto",
|
|
6
|
-
"
|
|
7
|
+
"anchor-name": "none",
|
|
8
|
+
"anchor-scope": "none",
|
|
7
9
|
"animation-delay": "0s",
|
|
8
10
|
"animation-direction": "normal",
|
|
9
11
|
"animation-duration": "0s",
|
|
@@ -12,11 +14,11 @@
|
|
|
12
14
|
"animation-name": "none",
|
|
13
15
|
"animation-range-end": "normal",
|
|
14
16
|
"animation-range-start": "normal",
|
|
15
|
-
"animation-timing-function": "ease",
|
|
16
17
|
"animation-timeline": "auto",
|
|
18
|
+
"animation-timing-function": "ease",
|
|
19
|
+
"animation-trigger": "none",
|
|
17
20
|
"appearance": "none",
|
|
18
21
|
"aspect-ratio": "auto",
|
|
19
|
-
"azimuth": "center",
|
|
20
22
|
"backdrop-filter": "none",
|
|
21
23
|
"background-attachment": "scroll",
|
|
22
24
|
"background-blend-mode": "normal",
|
|
@@ -25,9 +27,9 @@
|
|
|
25
27
|
"background-position-x": "0%",
|
|
26
28
|
"background-position-y": "0%",
|
|
27
29
|
"background-repeat": "repeat",
|
|
30
|
+
"baseline-shift": "0",
|
|
31
|
+
"baseline-source": "auto",
|
|
28
32
|
"block-size": "auto",
|
|
29
|
-
"border-block-style": "none",
|
|
30
|
-
"border-block-width": "medium",
|
|
31
33
|
"border-block-end-style": "none",
|
|
32
34
|
"border-block-end-width": "medium",
|
|
33
35
|
"border-block-start-style": "none",
|
|
@@ -42,8 +44,6 @@
|
|
|
42
44
|
"border-image-slice": "100%",
|
|
43
45
|
"border-image-source": "none",
|
|
44
46
|
"border-image-width": "1",
|
|
45
|
-
"border-inline-style": "none",
|
|
46
|
-
"border-inline-width": "medium",
|
|
47
47
|
"border-inline-end-style": "none",
|
|
48
48
|
"border-inline-end-width": "medium",
|
|
49
49
|
"border-inline-start-style": "none",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"border-left-width": "medium",
|
|
53
53
|
"border-right-style": "none",
|
|
54
54
|
"border-right-width": "medium",
|
|
55
|
+
"border-shape": "none",
|
|
55
56
|
"border-spacing": "0",
|
|
56
57
|
"border-start-end-radius": "0",
|
|
57
58
|
"border-start-start-radius": "0",
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
"break-before": "auto",
|
|
67
68
|
"break-inside": "auto",
|
|
68
69
|
"caption-side": "top",
|
|
70
|
+
"caret-animation": "auto",
|
|
69
71
|
"caret-color": "auto",
|
|
70
72
|
"caret-shape": "auto",
|
|
71
73
|
"clear": "none",
|
|
@@ -74,10 +76,12 @@
|
|
|
74
76
|
"color-scheme": "normal",
|
|
75
77
|
"column-count": "auto",
|
|
76
78
|
"column-gap": "normal",
|
|
79
|
+
"column-height": "auto",
|
|
77
80
|
"column-rule-style": "none",
|
|
78
81
|
"column-rule-width": "medium",
|
|
79
82
|
"column-span": "none",
|
|
80
83
|
"column-width": "auto",
|
|
84
|
+
"column-wrap": "auto",
|
|
81
85
|
"contain": "none",
|
|
82
86
|
"contain-intrinsic-block-size": "none",
|
|
83
87
|
"contain-intrinsic-height": "none",
|
|
@@ -86,12 +90,27 @@
|
|
|
86
90
|
"container-name": "none",
|
|
87
91
|
"container-type": "normal",
|
|
88
92
|
"content": "normal",
|
|
93
|
+
"corner-bottom-left-shape": "round",
|
|
94
|
+
"corner-bottom-right-shape": "round",
|
|
95
|
+
"corner-end-end-shape": "round",
|
|
96
|
+
"corner-end-start-shape": "round",
|
|
97
|
+
"corner-start-start-shape": "round",
|
|
98
|
+
"corner-start-end-shape": "round",
|
|
99
|
+
"corner-top-left-shape": "round",
|
|
100
|
+
"corner-top-right-shape": "round",
|
|
89
101
|
"counter-increment": "none",
|
|
90
102
|
"counter-reset": "none",
|
|
91
103
|
"counter-set": "none",
|
|
92
104
|
"cursor": "auto",
|
|
105
|
+
"cx": "0",
|
|
106
|
+
"cy": "0",
|
|
107
|
+
"d": "none",
|
|
93
108
|
"direction": "ltr",
|
|
109
|
+
"dominant-baseline": "auto",
|
|
94
110
|
"empty-cells": "show",
|
|
111
|
+
"field-sizing": "fixed",
|
|
112
|
+
"fill": "black",
|
|
113
|
+
"fill-opacity": "1",
|
|
95
114
|
"filter": "none",
|
|
96
115
|
"flex-basis": "auto",
|
|
97
116
|
"flex-direction": "row",
|
|
@@ -99,12 +118,13 @@
|
|
|
99
118
|
"flex-shrink": "1",
|
|
100
119
|
"flex-wrap": "nowrap",
|
|
101
120
|
"float": "none",
|
|
121
|
+
"flood-color": "black",
|
|
122
|
+
"flood-opacity": "black",
|
|
102
123
|
"font-feature-settings": "normal",
|
|
103
124
|
"font-kerning": "auto",
|
|
104
125
|
"font-language-override": "normal",
|
|
105
126
|
"font-optical-sizing": "auto",
|
|
106
127
|
"font-palette": "normal",
|
|
107
|
-
"font-variation-settings": "normal",
|
|
108
128
|
"font-size": "medium",
|
|
109
129
|
"font-size-adjust": "none",
|
|
110
130
|
"font-stretch": "normal",
|
|
@@ -121,8 +141,11 @@
|
|
|
121
141
|
"font-variant-ligatures": "normal",
|
|
122
142
|
"font-variant-numeric": "normal",
|
|
123
143
|
"font-variant-position": "normal",
|
|
144
|
+
"font-variation-settings": "normal",
|
|
124
145
|
"font-weight": "normal",
|
|
146
|
+
"font-width": "normal",
|
|
125
147
|
"forced-color-adjust": "auto",
|
|
148
|
+
"frame-sizing": "auto",
|
|
126
149
|
"grid-auto-columns": "auto",
|
|
127
150
|
"grid-auto-flow": "row",
|
|
128
151
|
"grid-auto-rows": "auto",
|
|
@@ -146,18 +169,20 @@
|
|
|
146
169
|
"initial-letter": "normal",
|
|
147
170
|
"initial-letter-align": "auto",
|
|
148
171
|
"inline-size": "auto",
|
|
149
|
-
"input-security": "auto",
|
|
150
172
|
"inset-block-end": "auto",
|
|
151
173
|
"inset-block-start": "auto",
|
|
152
174
|
"inset-inline-end": "auto",
|
|
153
175
|
"inset-inline-start": "auto",
|
|
154
176
|
"isolation": "auto",
|
|
177
|
+
"interactivity": "auto",
|
|
178
|
+
"interest-delay-end": "normal",
|
|
179
|
+
"interest-delay-start": "normal",
|
|
155
180
|
"justify-content": "normal",
|
|
156
181
|
"justify-items": "legacy",
|
|
157
182
|
"justify-self": "auto",
|
|
158
|
-
"justify-tracks": "normal",
|
|
159
183
|
"left": "auto",
|
|
160
184
|
"letter-spacing": "normal",
|
|
185
|
+
"lighting-color": "white",
|
|
161
186
|
"line-break": "auto",
|
|
162
187
|
"line-clamp": "none",
|
|
163
188
|
"line-height": "normal",
|
|
@@ -173,6 +198,9 @@
|
|
|
173
198
|
"margin-right": "0",
|
|
174
199
|
"margin-top": "0",
|
|
175
200
|
"margin-trim": "none",
|
|
201
|
+
"marker-end": "none",
|
|
202
|
+
"marker-mid": "none",
|
|
203
|
+
"marker-start": "none",
|
|
176
204
|
"mask-border-mode": "alpha",
|
|
177
205
|
"mask-border-outset": "0",
|
|
178
206
|
"mask-border-slice": "0",
|
|
@@ -183,7 +211,6 @@
|
|
|
183
211
|
"mask-position": "0% 0%",
|
|
184
212
|
"mask-repeat": "repeat",
|
|
185
213
|
"mask-size": "auto",
|
|
186
|
-
"masonry-auto-flow": "pack",
|
|
187
214
|
"math-depth": "0",
|
|
188
215
|
"math-shift": "normal",
|
|
189
216
|
"math-style": "normal",
|
|
@@ -198,6 +225,7 @@
|
|
|
198
225
|
"min-width": "auto",
|
|
199
226
|
"mix-blend-mode": "normal",
|
|
200
227
|
"object-fit": "fill",
|
|
228
|
+
"object-view-box": "none",
|
|
201
229
|
"offset-anchor": "auto",
|
|
202
230
|
"offset-distance": "0",
|
|
203
231
|
"offset-path": "none",
|
|
@@ -206,6 +234,7 @@
|
|
|
206
234
|
"opacity": "1",
|
|
207
235
|
"order": "0",
|
|
208
236
|
"orphans": "2",
|
|
237
|
+
"outline-color": "auto",
|
|
209
238
|
"outline-offset": "0",
|
|
210
239
|
"outline-style": "none",
|
|
211
240
|
"outline-width": "medium",
|
|
@@ -236,28 +265,37 @@
|
|
|
236
265
|
"perspective": "none",
|
|
237
266
|
"pointer-events": "auto",
|
|
238
267
|
"position": "static",
|
|
268
|
+
"position-anchor": "normal",
|
|
269
|
+
"position-area": "none",
|
|
270
|
+
"position-try-fallbacks": "none",
|
|
271
|
+
"position-try-order": "normal",
|
|
272
|
+
"r": "0",
|
|
273
|
+
"reading-flow": "normal",
|
|
274
|
+
"reading-order": "0",
|
|
239
275
|
"resize": "none",
|
|
240
276
|
"right": "auto",
|
|
241
277
|
"rotate": "none",
|
|
242
278
|
"row-gap": "normal",
|
|
279
|
+
"ruby-overhang": "auto",
|
|
280
|
+
"rx": "auto",
|
|
281
|
+
"ry": "auto",
|
|
243
282
|
"scale": "none",
|
|
244
|
-
"scrollbar-color": "auto",
|
|
245
|
-
"scrollbar-gutter": "auto",
|
|
246
|
-
"scrollbar-width": "auto",
|
|
247
283
|
"scroll-behavior": "auto",
|
|
248
|
-
"scroll-
|
|
284
|
+
"scroll-initial-target": "none",
|
|
249
285
|
"scroll-margin-block-end": "0",
|
|
286
|
+
"scroll-margin-block-start": "0",
|
|
250
287
|
"scroll-margin-bottom": "0",
|
|
251
|
-
"scroll-margin-inline-start": "0",
|
|
252
288
|
"scroll-margin-inline-end": "0",
|
|
289
|
+
"scroll-margin-inline-start": "0",
|
|
253
290
|
"scroll-margin-left": "0",
|
|
254
291
|
"scroll-margin-right": "0",
|
|
255
292
|
"scroll-margin-top": "0",
|
|
256
|
-
"scroll-
|
|
293
|
+
"scroll-marker-group": "none",
|
|
257
294
|
"scroll-padding-block-end": "auto",
|
|
295
|
+
"scroll-padding-block-start": "auto",
|
|
258
296
|
"scroll-padding-bottom": "auto",
|
|
259
|
-
"scroll-padding-inline-start": "auto",
|
|
260
297
|
"scroll-padding-inline-end": "auto",
|
|
298
|
+
"scroll-padding-inline-start": "auto",
|
|
261
299
|
"scroll-padding-left": "auto",
|
|
262
300
|
"scroll-padding-right": "auto",
|
|
263
301
|
"scroll-padding-top": "auto",
|
|
@@ -269,19 +307,41 @@
|
|
|
269
307
|
"scroll-snap-type": "none",
|
|
270
308
|
"scroll-snap-type-x": "none",
|
|
271
309
|
"scroll-snap-type-y": "none",
|
|
310
|
+
"scroll-target-group": "none",
|
|
272
311
|
"scroll-timeline-axis": "block",
|
|
273
312
|
"scroll-timeline-name": "none",
|
|
313
|
+
"scrollbar-color": "auto",
|
|
314
|
+
"scrollbar-gutter": "auto",
|
|
315
|
+
"scrollbar-width": "auto",
|
|
274
316
|
"shape-image-threshold": "0.0",
|
|
275
317
|
"shape-margin": "0",
|
|
276
318
|
"shape-outside": "none",
|
|
319
|
+
"shape-rendering": "auto",
|
|
320
|
+
"speak-as": "auto",
|
|
321
|
+
"stop-color": "black",
|
|
322
|
+
"stop-opacity": "black",
|
|
323
|
+
"stroke-dasharray": "none",
|
|
324
|
+
"stroke-dashoffset": "0",
|
|
325
|
+
"stroke-linecap": "butt",
|
|
326
|
+
"stroke-linejoin": "miter",
|
|
327
|
+
"stroke-miterlimit": "4",
|
|
328
|
+
"stroke-opacity": "1",
|
|
329
|
+
"stroke-width": "1px",
|
|
277
330
|
"tab-size": "8",
|
|
278
331
|
"table-layout": "auto",
|
|
279
332
|
"text-align-last": "auto",
|
|
333
|
+
"text-anchor": "start",
|
|
334
|
+
"text-autospace": "normal",
|
|
335
|
+
"text-box": "normal",
|
|
336
|
+
"text-box-edge": "auto",
|
|
337
|
+
"text-box-trim": "none",
|
|
280
338
|
"text-combine-upright": "none",
|
|
339
|
+
"text-decoration-inset": "0",
|
|
281
340
|
"text-decoration-line": "none",
|
|
282
341
|
"text-decoration-skip-ink": "auto",
|
|
283
342
|
"text-decoration-style": "solid",
|
|
284
343
|
"text-decoration-thickness": "auto",
|
|
344
|
+
"text-emphasis-position": "auto",
|
|
285
345
|
"text-emphasis-style": "none",
|
|
286
346
|
"text-indent": "0",
|
|
287
347
|
"text-justify": "auto",
|
|
@@ -289,11 +349,20 @@
|
|
|
289
349
|
"text-overflow": "clip",
|
|
290
350
|
"text-rendering": "auto",
|
|
291
351
|
"text-shadow": "none",
|
|
352
|
+
"text-spacing-trim": "normal",
|
|
292
353
|
"text-transform": "none",
|
|
293
354
|
"text-underline-offset": "auto",
|
|
294
355
|
"text-underline-position": "auto",
|
|
295
356
|
"text-wrap": "wrap",
|
|
357
|
+
"text-wrap-mode": "wrap",
|
|
358
|
+
"text-wrap-style": "auto",
|
|
296
359
|
"timeline-scope": "none",
|
|
360
|
+
"timeline-trigger-activation-range-end": "normal",
|
|
361
|
+
"timeline-trigger-activation-range-start": "normal",
|
|
362
|
+
"timeline-trigger-active-range-end": "auto",
|
|
363
|
+
"timeline-trigger-active-range-start": "auto",
|
|
364
|
+
"timeline-trigger-name": "none",
|
|
365
|
+
"timeline-trigger-source": "auto",
|
|
297
366
|
"top": "auto",
|
|
298
367
|
"touch-action": "auto",
|
|
299
368
|
"transform": "none",
|
|
@@ -304,12 +373,16 @@
|
|
|
304
373
|
"transition-property": "all",
|
|
305
374
|
"transition-timing-function": "ease",
|
|
306
375
|
"translate": "none",
|
|
376
|
+
"trigger-scope": "none",
|
|
307
377
|
"unicode-bidi": "normal",
|
|
308
378
|
"user-select": "auto",
|
|
379
|
+
"vector-effect": "none",
|
|
309
380
|
"view-timeline-axis": "block",
|
|
310
381
|
"view-timeline-inset": "auto",
|
|
311
382
|
"view-timeline-name": "none",
|
|
383
|
+
"view-transition-class": "none",
|
|
312
384
|
"view-transition-name": "none",
|
|
385
|
+
"view-transition-scope": "none",
|
|
313
386
|
"white-space": "normal",
|
|
314
387
|
"widows": "2",
|
|
315
388
|
"width": "auto",
|
|
@@ -317,5 +390,8 @@
|
|
|
317
390
|
"word-break": "normal",
|
|
318
391
|
"word-spacing": "normal",
|
|
319
392
|
"word-wrap": "normal",
|
|
320
|
-
"
|
|
393
|
+
"x": "0",
|
|
394
|
+
"y": "0",
|
|
395
|
+
"z-index": "auto",
|
|
396
|
+
"zoom": "1"
|
|
321
397
|
}
|
package/src/data/toInitial.json
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
+
"-webkit-text-fill-color": "currentcolor",
|
|
3
|
+
"-webkit-text-stroke-color": "currentcolor",
|
|
4
|
+
"alignment-baseline": "baseline",
|
|
2
5
|
"background-clip": "border-box",
|
|
3
6
|
"background-color": "transparent",
|
|
4
7
|
"background-origin": "padding-box",
|
|
@@ -8,7 +11,6 @@
|
|
|
8
11
|
"border-block-start-color": "currentcolor",
|
|
9
12
|
"border-bottom-color": "currentcolor",
|
|
10
13
|
"border-collapse": "separate",
|
|
11
|
-
"border-inline-color": "currentcolor",
|
|
12
14
|
"border-inline-end-color": "currentcolor",
|
|
13
15
|
"border-inline-start-color": "currentcolor",
|
|
14
16
|
"border-left-color": "currentcolor",
|
|
@@ -17,18 +19,21 @@
|
|
|
17
19
|
"box-sizing": "content-box",
|
|
18
20
|
"color": "canvastext",
|
|
19
21
|
"column-rule-color": "currentcolor",
|
|
22
|
+
"dynamic-range-limit": "no-limit",
|
|
20
23
|
"font-synthesis": "weight style small-caps position",
|
|
21
24
|
"image-orientation": "from-image",
|
|
25
|
+
"interpolate-size": "numeric-only",
|
|
22
26
|
"mask-clip": "border-box",
|
|
23
27
|
"mask-mode": "match-source",
|
|
24
28
|
"mask-origin": "border-box",
|
|
25
29
|
"mask-type": "luminance",
|
|
30
|
+
"position-visibility": "anchors-visible",
|
|
26
31
|
"ruby-align": "space-around",
|
|
27
32
|
"ruby-merge": "separate",
|
|
28
33
|
"ruby-position": "alternate",
|
|
34
|
+
"stroke-color": "transparent",
|
|
29
35
|
"text-decoration-color": "currentcolor",
|
|
30
36
|
"text-emphasis-color": "currentcolor",
|
|
31
|
-
"text-emphasis-position": "over right",
|
|
32
37
|
"transform-box": "view-box",
|
|
33
38
|
"transform-origin": "50% 50% 0",
|
|
34
39
|
"vertical-align": "baseline",
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
const
|
|
2
|
+
|
|
3
|
+
const getBrowsersList = require('#getBrowsersList');
|
|
4
4
|
const { isSupported } = require('caniuse-api');
|
|
5
5
|
const fromInitial = require('./data/fromInitial.json');
|
|
6
6
|
const toInitial = require('./data/toInitial.json');
|
|
@@ -12,13 +12,13 @@ const initial = 'initial';
|
|
|
12
12
|
const defaultIgnoreProps = ignoreProps;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
+
* @import browserslist from 'browserslist'
|
|
15
16
|
* @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions
|
|
16
17
|
* @typedef {Pick<browserslist.Options, 'stats' | 'path' | 'env'>} BrowserslistOptions
|
|
17
18
|
* @typedef {{ignore?: string[]} & AutoprefixerOptions & BrowserslistOptions} Options
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
* @type {import('postcss').PluginCreator<Options>}
|
|
22
22
|
* @param {Options} options
|
|
23
23
|
* @return {import('postcss').Plugin}
|
|
24
24
|
*/
|
|
@@ -31,19 +31,20 @@ function pluginCreator(options = {}) {
|
|
|
31
31
|
*/
|
|
32
32
|
prepare(result) {
|
|
33
33
|
const { stats, env, from, file } = result.opts || {};
|
|
34
|
-
const browsers =
|
|
35
|
-
stats: options.stats || stats,
|
|
36
|
-
path: options.path || dirname(from || file || __filename),
|
|
37
|
-
env: options.env || env,
|
|
38
|
-
});
|
|
34
|
+
const browsers = getBrowsersList(options, stats, from, file, env);
|
|
39
35
|
|
|
40
36
|
const initialSupport = isSupported('css-initial-value', browsers);
|
|
41
37
|
return {
|
|
38
|
+
/**
|
|
39
|
+
* @param {import('postcss').Root} css
|
|
40
|
+
*/
|
|
42
41
|
OnceExit(css) {
|
|
43
42
|
css.walkDecls((decl) => {
|
|
44
43
|
const lowerCasedProp = decl.prop.toLowerCase();
|
|
45
44
|
const ignoreProp = new Set(
|
|
46
|
-
defaultIgnoreProps.concat(
|
|
45
|
+
defaultIgnoreProps.concat(
|
|
46
|
+
/** @type {Options} */ (options).ignore || []
|
|
47
|
+
)
|
|
47
48
|
);
|
|
48
49
|
|
|
49
50
|
if (ignoreProp.has(lowerCasedProp)) {
|
|
@@ -52,9 +53,9 @@ function pluginCreator(options = {}) {
|
|
|
52
53
|
|
|
53
54
|
if (
|
|
54
55
|
initialSupport &&
|
|
55
|
-
Object.
|
|
56
|
+
Object.hasOwn(toInitial, lowerCasedProp) &&
|
|
56
57
|
decl.value.toLowerCase() ===
|
|
57
|
-
toInitial[/** @type
|
|
58
|
+
toInitial[/** @type keyof typeof toInitial */ (lowerCasedProp)]
|
|
58
59
|
) {
|
|
59
60
|
decl.value = initial;
|
|
60
61
|
return;
|
|
@@ -62,13 +63,17 @@ function pluginCreator(options = {}) {
|
|
|
62
63
|
|
|
63
64
|
if (
|
|
64
65
|
decl.value.toLowerCase() !== initial ||
|
|
65
|
-
!fromInitial[
|
|
66
|
+
!fromInitial[
|
|
67
|
+
/** @type keyof typeof fromInitial */ (lowerCasedProp)
|
|
68
|
+
]
|
|
66
69
|
) {
|
|
67
70
|
return;
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
decl.value =
|
|
71
|
-
fromInitial[
|
|
74
|
+
fromInitial[
|
|
75
|
+
/** @type keyof typeof fromInitial */ (lowerCasedProp)
|
|
76
|
+
];
|
|
72
77
|
});
|
|
73
78
|
},
|
|
74
79
|
};
|
|
@@ -77,4 +82,6 @@ function pluginCreator(options = {}) {
|
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
pluginCreator.postcss = true;
|
|
80
|
-
module.exports =
|
|
85
|
+
module.exports = /** @type {import('postcss').PluginCreator<Options>} */ (
|
|
86
|
+
pluginCreator
|
|
87
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const browserslist = require('browserslist');
|
|
4
|
+
const { dirname } = require('node:path');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {{overrideBrowserslist?: string | string[] | undefined, stats?: browserslist.Options["stats"], path?: browserslist.Options["path"], env?: browserslist.Options["env"]}} options
|
|
9
|
+
* @param {browserslist.Options["stats"]} stats
|
|
10
|
+
* @param {string|undefined} from
|
|
11
|
+
* @param {string} [file]
|
|
12
|
+
* @param {browserslist.Options["env"]} [env]
|
|
13
|
+
* @returns {string[]}
|
|
14
|
+
*/
|
|
15
|
+
module.exports = function computeBrowsersToSupport(
|
|
16
|
+
options,
|
|
17
|
+
stats,
|
|
18
|
+
from,
|
|
19
|
+
file,
|
|
20
|
+
env
|
|
21
|
+
) {
|
|
22
|
+
return browserslist(options.overrideBrowserslist, {
|
|
23
|
+
stats: options.stats || stats,
|
|
24
|
+
path: options.path || dirname(from || file || __filename),
|
|
25
|
+
env: options.env || env,
|
|
26
|
+
});
|
|
27
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = function () {
|
|
4
|
+
return [
|
|
5
|
+
'and_chr 150',
|
|
6
|
+
'and_ff 152',
|
|
7
|
+
'and_qq 14.9',
|
|
8
|
+
'and_uc 15.5',
|
|
9
|
+
'android 150',
|
|
10
|
+
'chrome 150',
|
|
11
|
+
'chrome 149',
|
|
12
|
+
'chrome 148',
|
|
13
|
+
'chrome 118',
|
|
14
|
+
'chrome 109',
|
|
15
|
+
'edge 150',
|
|
16
|
+
'edge 149',
|
|
17
|
+
'edge 148',
|
|
18
|
+
'firefox 152',
|
|
19
|
+
'firefox 151',
|
|
20
|
+
'firefox 140',
|
|
21
|
+
'ios_saf 26.5',
|
|
22
|
+
'ios_saf 26.4',
|
|
23
|
+
'ios_saf 26.3',
|
|
24
|
+
'ios_saf 18.5-18.7',
|
|
25
|
+
'kaios 3.0-3.1',
|
|
26
|
+
'op_mob 80',
|
|
27
|
+
'opera 131',
|
|
28
|
+
'opera 127',
|
|
29
|
+
'safari 26.5',
|
|
30
|
+
'safari 26.4',
|
|
31
|
+
'safari 26.3',
|
|
32
|
+
'samsung 30',
|
|
33
|
+
'samsung 29',
|
|
34
|
+
];
|
|
35
|
+
};
|
package/types/index.d.ts
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @typedef {{ignore?: string[]} & AutoprefixerOptions & BrowserslistOptions} Options
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @type {import('postcss').PluginCreator<Options>}
|
|
9
|
-
* @param {Options} options
|
|
10
|
-
* @return {import('postcss').Plugin}
|
|
11
|
-
*/
|
|
12
|
-
declare function pluginCreator(options?: Options): import("postcss").Plugin;
|
|
13
|
-
declare namespace pluginCreator {
|
|
14
|
-
export { postcss, AutoprefixerOptions, BrowserslistOptions, Options };
|
|
15
|
-
}
|
|
16
|
-
declare var postcss: true;
|
|
17
|
-
type AutoprefixerOptions = {
|
|
1
|
+
declare const _exports: import("postcss").PluginCreator<Options>;
|
|
2
|
+
export = _exports;
|
|
3
|
+
import type browserslist from 'browserslist';
|
|
4
|
+
export type AutoprefixerOptions = {
|
|
18
5
|
overrideBrowserslist?: string | string[];
|
|
19
6
|
};
|
|
20
|
-
type BrowserslistOptions = Pick<browserslist.Options,
|
|
21
|
-
type Options = {
|
|
7
|
+
export type BrowserslistOptions = Pick<browserslist.Options, 'stats' | 'path' | 'env'>;
|
|
8
|
+
export type Options = {
|
|
22
9
|
ignore?: string[];
|
|
23
10
|
} & AutoprefixerOptions & BrowserslistOptions;
|
|
24
|
-
import browserslist = require("browserslist");
|
|
25
11
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;AAcG,OAAQ,KAAA,YAAY,MAAM,cAAc,CACxC;AAAA,YAAwD,mBAAmB,GAAjE;IAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,CAAqB;AAC3E,YAAgE,mBAAmB,GAAzE,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,CAAqB;AACnF,YAA2E,OAAO,GAAxE;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAC,GAAG,mBAAmB,GAAG,mBAAmB,CAAS"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export = computeBrowsersToSupport;
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {{overrideBrowserslist?: string | string[] | undefined, stats?: browserslist.Options["stats"], path?: browserslist.Options["path"], env?: browserslist.Options["env"]}} options
|
|
5
|
+
* @param {browserslist.Options["stats"]} stats
|
|
6
|
+
* @param {string|undefined} from
|
|
7
|
+
* @param {string} [file]
|
|
8
|
+
* @param {browserslist.Options["env"]} [env]
|
|
9
|
+
* @returns {string[]}
|
|
10
|
+
*/
|
|
11
|
+
declare function computeBrowsersToSupport(options: {
|
|
12
|
+
overrideBrowserslist?: string | string[] | undefined;
|
|
13
|
+
stats?: browserslist.Options["stats"];
|
|
14
|
+
path?: browserslist.Options["path"];
|
|
15
|
+
env?: browserslist.Options["env"];
|
|
16
|
+
}, stats: browserslist.Options["stats"], from: string | undefined, file?: string, env?: browserslist.Options["env"]): string[];
|
|
17
|
+
import browserslist = require('browserslist');
|
|
18
|
+
//# sourceMappingURL=computeBrowsersToSupport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeBrowsersToSupport.d.ts","sourceRoot":"","sources":["../../src/lib/computeBrowsersToSupport.js"],"names":[],"mappings":";AAKA;;;;;;;;GAQG;0CAED,OAAO,EARE;IAAC,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;CAQtK,EACP,KAAK,EARI,YAAY,CAAC,OAAO,CAAC,OAAO,CAQhC,EACL,IAAI,EARK,MAAM,GAAC,SAQZ,EACJ,IAAI,AARH,CACA,EADQ,MAQL,EACJ,GAAG,AARF,CACA,EADQ,YAAY,CAAC,OAAO,CAAC,KAAK,CAQhC,GAPQ,MAAM,EAAE;OAVf,YAAY,WAAW,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBrowsersForWebBuild.d.ts","sourceRoot":"","sources":["../../src/lib/getBrowsersForWebBuild.js"],"names":[],"mappings":""}
|