Skip to content

Instantly share code, notes, and snippets.

@gscottolson
Created July 1, 2014 20:53
Show Gist options
  • Save gscottolson/abfccceba4ea737321c8 to your computer and use it in GitHub Desktop.
Save gscottolson/abfccceba4ea737321c8 to your computer and use it in GitHub Desktop.
React CSSMixin: vendor prefixed properties
module.exports = CSSMixin =
#
# Return the object containing the inline styles for `property` with
# vendor prefixes. Can be used with React inline styles:
# http://facebook.github.io/react/tips/inline-styles.html
#
getVendorPrefixedProperties: (property, value) ->
capitalizedProperty = "#{property.charAt(0).toUpperCase()}\
#{property.slice(1)}"
properties = {}
for prop in [
"Moz#{capitalizedProperty}"
"O#{capitalizedProperty}"
"Ms#{capitalizedProperty}"
"Webkit#{capitalizedProperty}"
"#{property}"
]
properties[prop] = value
properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment