Fix scroll direction for the SlideMotion component

This commit is contained in:
ErickSkrauch 2021-03-26 21:09:03 +01:00
parent 068115d7c2
commit bda3994138
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E
2 changed files with 8 additions and 3 deletions

View File

@ -77,9 +77,8 @@ class SlideMotion extends React.PureComponent<Props, State> {
<div
className={styles.container}
style={{
// TODO: inverse for RTL language
WebkitTransform: `translateX(-${interpolatingStyle.transform}%)`,
transform: `translateX(-${interpolatingStyle.transform}%)`,
// @ts-ignore see https://stackoverflow.com/a/52013197/5184751
'--transition-progress': `${interpolatingStyle.transform}%`,
}}
>
{React.Children.map(children, (child, index) => (

View File

@ -1,5 +1,11 @@
.container {
white-space: nowrap;
transform: translate(var(--transition-progress));
html[dir='ltr'] & {
// noinspection CssInvalidFunction works fine in a browser (:
transform: translate(calc(var(--transition-progress) * -1));
}
}
.item {