DEV Community

Discussion on: A Quick Guide To CSS Logical Properties

Collapse
 
jtojnar profile image
Jan Tojnar

Why not use something like translateX(calc(var(--IW-tx, 0) * var(--S-sx, 1))) instead of the scaling?

Collapse
 
madsstoumann profile image
Mads Stoumann

That's a great idea! I added it to the "inner" image instead of the wrapper, translateX(calc(var(--ob-I-tx, 0) * var(--ob-I-sx, 1))) – and then on rtl, it´s simply [dir="rtl"] .ob__img { --ob-I-sx: -1; }.