mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-24 04:25:27 +08:00
[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:
21
scripts/createPrefixer.js
Normal file
21
scripts/createPrefixer.js
Normal 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'),
|
||||
});
|
||||
Reference in New Issue
Block a user