[fix] unitless values for vendor prefixed properties

Problem:

Numeric values are suffixed with 'px', unless the property supports
unitless values. However, vendor prefixed properties were ignored
resulting in invalid CSS values for properties like
'-webkit-flex-shrink'.

Solution:

Apply the upstream solution from React, which includes vendor prefixed
properties in the "unitless number" map. Also build a custom vendor
prefixer to ensure adequate browser support (i.e., Safari 7 and older
Chrome).
This commit is contained in:
Nicolas Gallagher
2017-07-26 15:46:18 -07:00
parent 507e0d41f5
commit 092d5d12f7
9 changed files with 239 additions and 4 deletions

21
scripts/createPrefixer.js Normal file
View File

@@ -0,0 +1,21 @@
const generateData = require('inline-style-prefixer/generator');
const path = require('path');
const browserList = {
chrome: 38,
android: 4,
firefox: 40,
ios_saf: 7,
safari: 7,
ie: 11,
ie_mob: 11,
edge: 12,
opera: 16,
op_mini: 12,
and_uc: 9,
and_chr: 38
};
generateData(browserList, {
staticPath: path.join(__dirname, '../src/modules/prefixStyles/static.js'),
});