@@ -52,12 +52,12 @@ const transformShorthandValue =
52
52
process . env . NODE_ENV === 'production'
53
53
? baseTransformShorthandValue
54
54
: ( propName , value ) => {
55
- try {
56
- return baseTransformShorthandValue ( propName , value )
57
- } catch ( e ) {
58
- throw new Error ( `Failed to parse declaration "${ propName } : ${ value } "` )
59
- }
55
+ try {
56
+ return baseTransformShorthandValue ( propName , value )
57
+ } catch ( e ) {
58
+ throw new Error ( `Failed to parse declaration "${ propName } : ${ value } "` )
60
59
}
60
+ }
61
61
62
62
export const getStylesForProperty = ( propName , inputValue , allowShorthand ) => {
63
63
const isRawValue = allowShorthand === false || ! ( propName in transforms )
@@ -70,12 +70,21 @@ export const getStylesForProperty = (propName, inputValue, allowShorthand) => {
70
70
return propValues
71
71
}
72
72
73
+ const cssRtLToNativeCamelized = {
74
+ "margin-inline-start" : "marginStart" ,
75
+ "margin-inline-end" : "marginEnd" ,
76
+ "padding-inline-start" : "paddingStart" ,
77
+ "padding-inline-end" : "paddingEnd" ,
78
+ "inset-inline-start" : "start" ,
79
+ "inset-inline-end" : "end"
80
+ }
81
+
73
82
export const getPropertyName = propName => {
74
83
const isCustomProp = / ^ - - \w + / . test ( propName )
75
84
if ( isCustomProp ) {
76
85
return propName
77
86
}
78
- return camelizeStyleName ( propName )
87
+ return cssRtLToNativeCamelized [ propName ] || camelizeStyleName ( propName )
79
88
}
80
89
81
90
export default ( rules , shorthandBlacklist = [ ] ) =>
0 commit comments