animxyz icon indicating copy to clipboard operation
animxyz copied to clipboard

Utilities with Logical Properties

Open Ayman97 opened this issue 4 years ago • 2 comments

Hey It would be so useful if you add the support of logical properties like (inline-start, inline-end, block-start, block-end) in addition to: top, left, right, bottom.

It would be useful in multilanguage websites to make consistent animations without making some weird hacks.

Ayman97 avatar Jan 21 '21 13:01 Ayman97

Unfortunately I don't believe that would be possible given that our translations are using the css "translate" function which doesn't change based on language like the logical properties do. https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate()

CSS may implement this in the future but until then we will likely stick with screen directions (up down left right).

In the mean time you can use the --xyz-translate-x and --xyz-translate-y for full control over translations allowing you to customize as needed.

Thanks for the feedback!

milesingrams avatar Jan 21 '21 15:01 milesingrams

This is an interesting ask. I can definitely see that you would want animations to switch direction for an RTL language site compared to an LTR site.

Perhaps you can set up a dynamic xyz attribute (v-xyz in our Vue docs) to switch left to right etc if it detects a different language mode?

mattaningram avatar Jan 21 '21 18:01 mattaningram