10000 Merge pull request #18327 from twbs/prefixing · liuwenye2010/bootstrap@de86a08 · GitHub
[go: up one dir, main page]

Skip to content

Commit de86a08

Browse files
committed
Merge pull request twbs#18327 from twbs/prefixing
Gruntfile: Add comments explaining CSS prefixing policy
2 parents fd43ce2 + 5482e2c commit de86a08

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

Gruntfile.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,33 @@ module.exports = function (grunt) {
2323
var mq4HoverShim = require('mq4-hover-shim');
2424
var autoprefixer = require('autoprefixer')({
2525
browsers: [
26-
'Android 2.3',
27-
'Android >= 4',
28-
'Chrome >= 35',
29-
'Firefox >= 31',
26+
//
27+
// Official browser support policy:
28+
// http://v4-alpha.getbootstrap.com/getting-started/browsers-devices/#supported-browsers
29+
//
30+
'Chrome >= 35', // Exact version number here is kinda arbitrary
31+
// Rather than using Autoprefixer's native "Firefox ESR" version specifier string,
32+
// we deliberately hardcode the number. This is to avoid unwittingly severely breaking the previous ESR in the event that:
33+
// (a) we happen to ship a new Bootstrap release soon after the release of a new ESR,
34+
// such that folks haven't yet had a reasonable amount of time to upgrade; and
35+
// (b) the new ESR has unprefixed CSS properties/values whose absence would severely break webpages
36+
// (e.g. `box-sizing`, as opposed to `background: linear-gradient(...)`).
37+
// Since they've been unprefixed, Autoprefixer will stop prefixing them,
38+
// thus causing them to not work in the previous ESR (where the prefixes were required).
39+
'Firefox >= 31', // Current Firefox Extended Support Release (ESR)
3040
// Note: Edge versions in Autoprefixer & Can I Use refer to the EdgeHTML rendering engine version,
3141
// NOT the Edge app version shown in Edge's "About" screen.
3242
// For example, at the time of writing, Edge 20 on an up-to-date system uses EdgeHTML 12.
3343
// See also https://github.com/Fyrd/caniuse/issues/1928
3444
'Edge >= 12',
3545
'Explorer >= 9',
46+
// Out of leniency, we prefix these 1 version further back than the official policy.
3647
'iOS >= 7',
37-
'Opera >= 12',
38-
'Safari >= 7.1'
48+
'Safari >= 7.1',
49+
// The following remain NOT officially supported, but we're lenient and include their prefixes to avoid severely breaking in them.
50+
'Android 2.3',
51+
'Android >= 4',
52+
'Opera >= 12'
3953
]
4054
});
4155

0 commit comments

Comments
 (0)
0