mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-23 20:10:41 +08:00
17 lines
517 B
JavaScript
17 lines
517 B
JavaScript
import prefixAll from 'inline-style-prefixer/static';
|
|
|
|
const processVendorPrefixes = (style) => {
|
|
const prefixedStyles = prefixAll(style);
|
|
// React@15 removed undocumented support for fallback values in
|
|
// inline-styles. Revert array values to the standard CSS value
|
|
for (const prop in prefixedStyles) {
|
|
const value = prefixedStyles[prop];
|
|
if (Array.isArray(value)) {
|
|
prefixedStyles[prop] = value[value.length - 1];
|
|
}
|
|
}
|
|
return prefixedStyles;
|
|
};
|
|
|
|
module.exports = processVendorPrefixes;
|