diff --git a/src/cssjanus.js b/src/cssjanus.js index ad03889..4aa4734 100644 --- a/src/cssjanus.js +++ b/src/cssjanus.js @@ -149,8 +149,8 @@ function CSSJanus() { textShadow1RegExp = new RegExp( '(text-shadow\\s*:\\s*)' + signedQuantPattern + '(\\s*)' + colorPattern, 'gi' ), textShadow2RegExp = new RegExp( '(text-shadow\\s*:\\s*)' + colorPattern + '(\\s*)' + signedQuantPattern, 'gi' ), textShadow3RegExp = new RegExp( '(text-shadow\\s*:\\s*)' + signedQuantPattern, 'gi' ), - translateXRegExp = new RegExp( '(transform\\s*:[^;]*)(translateX\\s*\\(\\s*)' + signedQuantPattern + '(\\s*\\))', 'gi' ), - translateRegExp = new RegExp( '(transform\\s*:[^;]*)(translate\\s*\\(\\s*)' + signedQuantPattern + '((?:\\s*,\\s*' + signedQuantPattern + '){0,2}\\s*\\))', 'gi' ); + translateXRegExp = new RegExp( '(transform\\s*:[^;}]*)(translateX\\s*\\(\\s*)' + signedQuantPattern + '(\\s*\\))', 'gi' ), + translateRegExp = new RegExp( '(transform\\s*:[^;}]*)(translate\\s*\\(\\s*)' + signedQuantPattern + '((?:\\s*,\\s*' + signedQuantPattern + '){0,2}\\s*\\))', 'gi' ); /** * Invert the horizontal value of a background position property. diff --git a/test/data.json b/test/data.json index 178cf90..c9dd08b 100644 --- a/test/data.json +++ b/test/data.json @@ -458,6 +458,10 @@ ], [ ".foo { transform: translateY( 30px ); }" + ], + [ + ".foo { transform: translate( 10px ) } .bar { transform: translate( 10px ) }", + ".foo { transform: translate( -10px ) } .bar { transform: translate( -10px ) }" ] ] },