Created
September 4, 2017 05:52
-
-
Save itsdouges/ba109f72db2c27c73f792bde2db51fa4 to your computer and use it in GitHub Desktop.
Prefixes inline styles with vendor browser prefixes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import upperFirst from 'lodash/upperFirst'; | |
const vendors = ['Webkit', 'Moz', 'ms', 'O']; | |
// eslint-disable-next-line import/prefer-default-export | |
export function prefix (key: string, value: string): { [key: string]: string } { | |
const obj = { | |
[key]: value, | |
}; | |
vendors.forEach((vendor) => (obj[`${vendor}${upperFirst(key)}`] = value)); | |
return obj; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment