Skip to content

Commit 70adac5

Browse files
authored
feat(build): adjust autoprefixer config to match 2.9.0 browser support
The default browserlist settings were still supporting old legacy browsers which we reduced in 2.9.0. This PR adjust the browserlist setting so much less prefixes (if any) are added to the css files. This PR also allows to configure a whole autoprefixer prefix-config instead of only the overrideBrowserslist attribute.
1 parent b3dc749 commit 70adac5

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Fomantic includes an interactive installer to help setup your project.
5757
* IE 11[^2]
5858
* Microsoft Edge 12-44[^2]
5959

60-
[^1]: Fomantic-UI should basically still work in iOS Safari 9+, Android 4.4+, but, starting from v2.9.0, we won't support them anymore if anything works different than in recent versions.
60+
[^1]: Fomantic-UI should basically still work in iOS Safari 9+, Android 6+, but, starting from v2.9.0, we won't support them anymore if anything works different than in recent versions.
6161
[^2]: Fomantic-UI should basically still work in IE11 / old Edge, but, starting from v2.9.0, we won't support them anymore in terms of dedicated bugfixes.
6262

6363
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@octokit/core": "^3.6.0",
3535
"@octokit/rest": "^16.16.0",
3636
"better-console": "^1.0.1",
37-
"browserslist": "^4.19.1",
37+
"browserslist": "^4.21.4",
3838
"del": "^6.1.1",
3939
"extend": "^3.0.2",
4040
"gulp": "^4.0.0",

tasks/config/tasks.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ let defaultBrowsers = browserslist(browserslist.defaults);
99
let userBrowsers = browserslist();
1010
let hasBrowserslistConfig = JSON.stringify(defaultBrowsers) !== JSON.stringify(userBrowsers);
1111

12-
let overrideBrowserslist = hasBrowserslistConfig ? undefined : [
13-
'last 2 versions',
14-
'> 1%',
15-
'opera 12.1',
16-
'bb 10',
17-
'android 4',
18-
];
12+
var prefix = config.prefix || {};
13+
if (!prefix.overrideBrowserslist && !hasBrowserslistConfig) {
14+
prefix.overrideBrowserslist = [
15+
'last 2 Chrome versions',
16+
'last 2 Firefox versions',
17+
'last 2 Safari versions',
18+
'last 4 iOS major versions',
19+
'last 4 Android major versions',
20+
'last 4 ChromeAndroid versions',
21+
'Edge 12',
22+
'ie 11',
23+
];
24+
}
1925

2026
// Node 12 does not support ??, so a little polyfill
2127
let nullish = (value, fallback) => (value !== undefined && value !== null ? value : fallback);
@@ -136,10 +142,8 @@ module.exports = {
136142
},
137143
},
138144

139-
/* What Browsers to Prefix */
140-
prefix: {
141-
overrideBrowserslist: overrideBrowserslist,
142-
},
145+
/* Browserslist Prefix config */
146+
prefix: prefix,
143147

144148
/* File Renames */
145149
rename: {

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ braces@^3.0.2:
774774
dependencies:
775775
fill-range "^7.0.1"
776776

777-
browserslist@^4.19.1, browserslist@^4.21.4:
777+
browserslist@^4.21.4:
778778
version "4.21.4"
779779
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987"
780780
integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==

0 commit comments

Comments
 (0)