[fix] StyleSheet: support for 'transform' and 'transformMatrix'

Fix #46
This commit is contained in:
Nicolas Gallagher
2016-03-15 13:32:02 -07:00
parent 56549cf794
commit ee4c544957
2 changed files with 6 additions and 3 deletions

View File

@@ -8,6 +8,7 @@
import prefixAll from 'inline-style-prefix-all'
import flattenStyle from './flattenStyle'
import processTransform from './processTransform'
class StyleSheetRegistry {
static registerStyle(style: Object, store): number {
@@ -15,7 +16,7 @@ class StyleSheetRegistry {
Object.freeze(style)
}
const normalizedStyle = flattenStyle(style)
const normalizedStyle = processTransform(flattenStyle(style))
Object.keys(normalizedStyle).forEach((prop) => {
// add each declaration to the store
store.set(prop, normalizedStyle[prop])
@@ -26,7 +27,7 @@ class StyleSheetRegistry {
let _className
let _style = {}
const classList = []
const normalizedStyle = flattenStyle(style)
const normalizedStyle = processTransform(flattenStyle(style))
for (const prop in normalizedStyle) {
let styleClass = store.get(prop, normalizedStyle[prop])

View File

@@ -38,7 +38,9 @@ const TransformPropTypes = {
PropTypes.shape({ skewX: numberOrString }),
PropTypes.shape({ skewY: numberOrString }),
PropTypes.shape({ translateX: numberOrString }),
PropTypes.shape({ translateY: numberOrString })
PropTypes.shape({ translateY: numberOrString }),
PropTypes.shape({ translateZ: numberOrString }),
PropTypes.shape({ translate3d: PropTypes.string })
])
),
transformMatrix: TransformMatrixPropType