Skip to content

Commit c62ac6b

Browse files
authored
Re-introduce support for browserhacks (#258)
Includes all types of browserhacks from browserhacks.com: - properties - values - at-media - at-supports
1 parent eefa3b5 commit c62ac6b

18 files changed

+752
-261
lines changed

package-lock.json

Lines changed: 168 additions & 200 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
"css-tree": "2.2.1"
4646
},
4747
"devDependencies": {
48-
"microbundle": "^0.15.0",
48+
"microbundle": "^0.15.1",
4949
"uvu": "^0.5.6"
5050
},
5151
"mangle": {
5252
"regex": "^_[^_]"
5353
}
54-
}
54+
}

src/__fixtures__/bol-com-20190617.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,13 @@
142142
"(min-width:112.5em)": 7,
143143
"(max-width: 56.1875em)": 3
144144
},
145-
"uniquenessRatio": 0.07360406091370558
145+
"uniquenessRatio": 0.07360406091370558,
146+
"browserhacks": {
147+
"total": 0,
148+
"totalUnique": 0,
149+
"unique": {},
150+
"uniquenessRatio": 0
151+
}
146152
},
147153
"charset": {
148154
"total": 1,
@@ -160,7 +166,13 @@
160166
"((-webkit-backdrop-filter:blur()) or (backdrop-filter:blur()))": 2,
161167
"(display:grid)": 1
162168
},
163-
"uniquenessRatio": 0.75
169+
"uniquenessRatio": 0.75,
170+
"browserhacks": {
171+
"total": 0,
172+
"totalUnique": 0,
173+
"unique": {},
174+
"uniquenessRatio": 0
175+
}
164176
},
165177
"keyframes": {
166178
"total": 9,
@@ -57682,6 +57694,12 @@
5768257694
},
5768357695
"uniquenessRatio": 0.75
5768457696
},
57697+
"browserhacks": {
57698+
"total": 0,
57699+
"totalUnique": 0,
57700+
"unique": {},
57701+
"uniquenessRatio": 0
57702+
},
5768557703
"units": {
5768657704
"total": 3004,
5768757705
"totalUnique": 7,

src/__fixtures__/bootstrap-5.0.0.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@
6666
"(prefers-reduced-motion: reduce)": 24,
6767
"print": 1
6868
},
69-
"uniquenessRatio": 0.14942528735632185
69+
"uniquenessRatio": 0.14942528735632185,
70+
"browserhacks": {
71+
"total": 0,
72+
"totalUnique": 0,
73+
"unique": {},
74+
"uniquenessRatio": 0
75+
}
7076
},
7177
"charset": {
7278
"total": 1,
@@ -80,7 +86,13 @@
8086
"total": 0,
8187
"totalUnique": 0,
8288
"unique": {},
83-
"uniquenessRatio": 0
89+
"uniquenessRatio": 0,
90+
"browserhacks": {
91+
"total": 0,
92+
"totalUnique": 0,
93+
"unique": {},
94+
"uniquenessRatio": 0
95+
}
8496
},
8597
"keyframes": {
8698
"total": 6,
@@ -25223,6 +25235,12 @@
2522325235
},
2522425236
"uniquenessRatio": 0.5454545454545454
2522525237
},
25238+
"browserhacks": {
25239+
"total": 0,
25240+
"totalUnique": 0,
25241+
"unique": {},
25242+
"uniquenessRatio": 0
25243+
},
2522625244
"units": {
2522725245
"total": 1571,
2522825246
"totalUnique": 7,

src/__fixtures__/cnn-20220403.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,15 @@
968968
"only screen and (max-width: 896px) and (max-height: 425px) and (orientation: landscape)": 1,
969969
"only screen and (max-width: 530px)": 1
970970
},
971-
"uniquenessRatio": 0.17367949865711726
971+
"uniquenessRatio": 0.17367949865711726,
972+
"browserhacks": {
973+
"total": 1,
974+
"totalUnique": 1,
975+
"unique": {
976+
"screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none)": 1
977+
},
978+
"uniquenessRatio": 1
979+
}
972980
},
973981
"charset": {
974982
"total": 1,
@@ -982,7 +990,13 @@
982990
"total": 0,
983991
"totalUnique": 0,
984992
"unique": {},
985-
"uniquenessRatio": 0
993+
"uniquenessRatio": 0,
994+
"browserhacks": {
995+
"total": 0,
996+
"totalUnique": 0,
997+
"unique": {},
998+
"uniquenessRatio": 0
999+
}
9861000
},
9871001
"keyframes": {
9881002
"total": 47,
@@ -155265,6 +155279,12 @@
155265155279
},
155266155280
"uniquenessRatio": 0.3282442748091603
155267155281
},
155282+
"browserhacks": {
155283+
"total": 0,
155284+
"totalUnique": 0,
155285+
"unique": {},
155286+
"uniquenessRatio": 0
155287+
},
155268155288
"units": {
155269155289
"total": 11295,
155270155290
"totalUnique": 12,

src/__fixtures__/css-tricks-20190319.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@
7272
"only screen and (max-width: 320px)": 1,
7373
"only screen and (max-width: 240px)": 1
7474
},
75-
"uniquenessRatio": 0.16535433070866143
75+
"uniquenessRatio": 0.16535433070866143,
76+
"browserhacks": {
77+
"total": 0,
78+
"totalUnique": 0,
79+
"unique": {},
80+
"uniquenessRatio": 0
81+
}
7682
},
7783
"charset": {
7884
"total": 1,
@@ -89,7 +95,13 @@
8995
"(-webkit-overflow-scrolling:touch)": 1,
9096
"((position:-webkit-sticky) or (position:sticky))": 5
9197
},
92-
"uniquenessRatio": 0.3333333333333333
98+
"uniquenessRatio": 0.3333333333333333,
99+
"browserhacks": {
100+
"total": 0,
101+
"totalUnique": 0,
102+
"unique": {},
103+
"uniquenessRatio": 0
104+
}
93105
},
94106
"keyframes": {
95107
"total": 11,
@@ -21565,6 +21577,12 @@
2156521577
},
2156621578
"uniquenessRatio": 0.16666666666666666
2156721579
},
21580+
"browserhacks": {
21581+
"total": 0,
21582+
"totalUnique": 0,
21583+
"unique": {},
21584+
"uniquenessRatio": 0
21585+
},
2156821586
"units": {
2156921587
"total": 1972,
2157021588
"totalUnique": 9,

src/__fixtures__/facebook-20190319.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@
8383
"(min-width: 1030px)": 2,
8484
"(min-width: 1155px)": 2
8585
},
86-
"uniquenessRatio": 0.39215686274509803
86+
"uniquenessRatio": 0.39215686274509803,
87+
"browserhacks": {
88+
"total": 0,
89+
"totalUnique": 0,
90+
"unique": {},
91+
"uniquenessRatio": 0
92+
}
8793
},
8894
"charset": {
8995
"total": 0,
@@ -95,7 +101,13 @@
95101
"total": 0,
96102
"totalUnique": 0,
97103
"unique": {},
98-
"uniquenessRatio": 0
104+
"uniquenessRatio": 0,
105+
"browserhacks": {
106+
"total": 0,
107+
"totalUnique": 0,
108+
"unique": {},
109+
"uniquenessRatio": 0
110+
}
99111
},
100112
"keyframes": {
101113
"total": 17,
@@ -41417,6 +41429,12 @@
4141741429
},
4141841430
"uniquenessRatio": 0.5714285714285714
4141941431
},
41432+
"browserhacks": {
41433+
"total": 0,
41434+
"totalUnique": 0,
41435+
"unique": {},
41436+
"uniquenessRatio": 0
41437+
},
4142041438
"units": {
4142141439
"total": 5127,
4142241440
"totalUnique": 9,

src/__fixtures__/gazelle-20210905.json

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,17 @@
163163
"screen and (device-aspect-ratio: 9 / 16)": 1,
164164
"screen and (max-width: 380px)": 1
165165
},
166-
"uniquenessRatio": 0.08242424242424243
166+
"uniquenessRatio": 0.08242424242424243,
167+
"browserhacks": {
168+
"total": 4,
169+
"totalUnique": 3,
170+
"unique": {
171+
"screen and (-ms-high-contrast:active), (-ms-high-contrast:none)": 2,
172+
"not all and (min-resolution:.001dpcm)": 1,
173+
"screen and (-webkit-min-device-pixel-ratio:0)": 1
174+
},
175+
"uniquenessRatio": 0.75
176+
}
167177
},
168178
"charset": {
169179
"total": 0,
@@ -179,7 +189,16 @@
179189
"(-webkit-appearance: none) and (not (stroke-color:transparent))": 1,
180190
"(-webkit-appearance:none)": 1
181191
},
182-
"uniquenessRatio": 1
192+
"uniquenessRatio": 1,
193+
"browserhacks": {
194+
"total": 2,
195+
"totalUnique": 2,
196+
"unique": {
197+
"(-webkit-appearance: none) and (not (stroke-color:transparent))": 1,
198+
"(-webkit-appearance:none)": 1
199+
},
200+
"uniquenessRatio": 1
201+
}
183202
},
184203
"keyframes": {
185204
"total": 29,
@@ -96252,6 +96271,14 @@
9625296271
},
9625396272
"uniquenessRatio": 0.15698924731182795
9625496273
},
96274+
"browserhacks": {
96275+
"total": 1,
96276+
"totalUnique": 1,
96277+
"unique": {
96278+
"4px solid\\9": 1
96279+
},
96280+
"uniquenessRatio": 1
96281+
},
9625596282
"units": {
9625696283
"total": 7696,
9625796284
"totalUnique": 10,

src/__fixtures__/github-20210501.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@
5454
"(min-width:768px) and (max-width:1011px)": 1,
5555
"print": 1
5656
},
57-
"uniquenessRatio": 0.10619469026548672
57+
"uniquenessRatio": 0.10619469026548672,
58+
"browserhacks": {
59+
"total": 3,
60+
"totalUnique": 2,
61+
"unique": {
62+
"only screen and (-moz-min-device-pixel-ratio:2), only screen and (-webkit-min-device-pixel-ratio:2), only screen and (min--moz-device-pixel-ratio:2), only screen and (min-device-pixel-ratio:2), only screen and (min-resolution:2dppx), only screen and (min-resolution:192dpi)": 2,
63+
"screen and (min-width:0\\0)": 1
64+
},
65+
"uniquenessRatio": 0.6666666666666666
66+
}
5867
},
5968
"charset": {
6069
"total": 0,
@@ -69,7 +78,13 @@
6978
"(-webkit-touch-callout:none)": 1,
7079
"((-webkit-clip-path:polygon(50% 0, 100% 50%, 50% 100%)) or (clip-path:polygon(50% 0, 100% 50%, 50% 100%)))": 1
7180
},
72-
"uniquenessRatio": 1
81+
"uniquenessRatio": 1,
82+
"browserhacks": {
83+
"total": 0,
84+
"totalUnique": 0,
85+
"unique": {},
86+
"uniquenessRatio": 0
87+
}
7388
},
7489
"keyframes": {
7590
"total": 13,
@@ -36228,6 +36243,12 @@
3622836243
},
3622936244
"uniquenessRatio": 0.6363636363636364
3623036245
},
36246+
"browserhacks": {
36247+
"total": 0,
36248+
"totalUnique": 0,
36249+
"unique": {},
36250+
"uniquenessRatio": 0
36251+
},
3623136252
"units": {
3623236253
"total": 1977,
3623336254
"totalUnique": 6,

src/__fixtures__/lego-20190617.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,13 @@
449449
"screen and (min-width:48em) and (max-width:73.4375em)": 1,
450450
"screen and (max-width:61.4375em)": 4
451451
},
452-
"uniquenessRatio": 0.07123287671232877
452+
"uniquenessRatio": 0.07123287671232877,
453+
"browserhacks": {
454+
"total": 0,
455+
"totalUnique": 0,
456+
"unique": {},
457+
"uniquenessRatio": 0
458+
}
453459
},
454460
"charset": {
455461
"total": 1,
@@ -463,7 +469,13 @@
463469
"total": 0,
464470
"totalUnique": 0,
465471
"unique": {},
466-
"uniquenessRatio": 0
472+
"uniquenessRatio": 0,
473+
"browserhacks": {
474+
"total": 0,
475+
"totalUnique": 0,
476+
"unique": {},
477+
"uniquenessRatio": 0
478+
}
467479
},
468480
"keyframes": {
469481
"total": 24,
@@ -23149,6 +23161,12 @@
2314923161
},
2315023162
"uniquenessRatio": 0.042071197411003236
2315123163
},
23164+
"browserhacks": {
23165+
"total": 0,
23166+
"totalUnique": 0,
23167+
"unique": {},
23168+
"uniquenessRatio": 0
23169+
},
2315223170
"units": {
2315323171
"total": 1431,
2315423172
"totalUnique": 8,

0 commit comments

Comments
 (0)