New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add patterns for translate(x[,y,z]) and translateX(x) #45
Conversation
I'll first add a visual test on the demo to make it easier to see the problem and confirm the fix. |
Visual test? |
See https://cssjanus.github.io/demo/. I've verified the fix to behave as one would expected (the current demo shows that it isn't being flipped). Sometimes the flipping of the values is not entirely intuitive. A visual confirmation makes it easier to review. |
We may want to limit this to values in transforms, but then we need to take care to properly support multiple values as well such as |
For multiple arbitrary transformations (rotate, skew, matrix, etc) something like "transform: scaleX(-1) [original transformations] scaleX(-1)" should do the trick. As in: LTR: http://codepen.io/anon/pen/WRZJyK The transform-origin property can be a problem when unit lengths are involved. Might be possible with CSS calc. |
We should also tag 1.1.4 so PHP can use the new tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If infeasible or needlessly complex, I'm willing to reconsider. But I'd prefer to be a bit more future-proof and avoiding false-positives by limiting this to matches on property transform:
instead of just anywhere.
Our current regex-based approach is already a bit fragile and prone to false-positives (especially in freeform strings), but I'd like to limit that as much as we can with little effort.
Added match for transform property - this now only matches one 'transform' per rule, but having multiple transformX's or a transform+transformX would be nonsensical. |
No description provided.