Skip to content

Commit

Permalink
Fix bug where transform() didn't flip on semicolon-less property
Browse files Browse the repository at this point in the history
Fixes #69.
Closes #70.
  • Loading branch information
YairRand authored and Krinkle committed Oct 11, 2018
1 parent 569d68a commit f5b34a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cssjanus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions test/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@
],
[
".foo { transform: translateY( 30px ); }"
],
[
".foo { transform: translate( 10px ) } .bar { transform: translate( 10px ) }",
".foo { transform: translate( -10px ) } .bar { transform: translate( -10px ) }"
]
]
},
Expand Down

0 comments on commit f5b34a1

Please sign in to comment.