Skip to content

Commit

Permalink
dynamicweb#86 Convert CSS to logical CSS for LTR & RTL support
Browse files Browse the repository at this point in the history
  • Loading branch information
heyyo-droid committed Mar 1, 2024
1 parent afb6cfe commit 84b3710
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 32 deletions.
34 changes: 20 additions & 14 deletions dist/css/swiffy-slider.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
.slider-item-ratio .slider-container>*>* {
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
width: 100%;
height: 100%;
object-fit: cover;
Expand All @@ -102,7 +102,7 @@

.slider-item-ratio .slider-container>*::after {
display: block;
padding-top: calc( 100% / (var(--swiffy-slider-item-ratio)));
padding-block-start: calc( 100% / (var(--swiffy-slider-item-ratio)));
content: "";
}

Expand Down Expand Up @@ -148,9 +148,9 @@

.slider-indicators {
position: absolute;
right: 2rem;
inset-inline-end: 2rem;
bottom: 0;
left: 2rem;
inset-inline-start: 2rem;
display: flex;
justify-content: center;
padding: 0;
Expand Down Expand Up @@ -217,7 +217,7 @@
.slider-nav {
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
bottom: 0;
border: 0;
background-color: transparent;
Expand Down Expand Up @@ -251,6 +251,9 @@
width: 3rem;
height: 3rem;
}
[dir=rtl] .slider-nav::after {
transform: rotate(180deg);
}

.slider-nav-arrow .slider-nav::after {
mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'><path fill-rule='evenodd' d='M12 8a.5.5 0 0 1-.5.5H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H11.5a.5.5 0 0 1 .5.5z'></path></svg>");
Expand Down Expand Up @@ -339,10 +342,13 @@
.slider-nav.slider-nav-next::after {
transform: rotate(180deg);
}
[dir=rtl] .slider-nav.slider-nav-next::after {
transform: unset;
}

.slider-nav.slider-nav-next {
right: 0;
left: unset;
inset-inline-end:0;
inset-inline-start: unset;
}

.slider-nav-visible .slider-nav {
Expand Down Expand Up @@ -482,24 +488,24 @@
content: " ";
display: block;
position: absolute;
left: calc((var(--swiffy-slider-item-gap)/2)*-1);
inset-inline-start: calc((var(--swiffy-slider-item-gap)/2)*-1);
top: 0;
/*FF fix setting w+h to 1 px - otherwise snap will not occur*/
width: 1px;
height: 1px;
scroll-snap-align: var(--swiffy-slider-snap-align);
}
.slider-nav-outside-expand .slider-nav {
margin-left: -4rem;
margin-inline-start: -4rem;
}
.slider-nav-outside-expand .slider-nav.slider-nav-next {
margin-right: -4rem;
margin-inline-end: -4rem;
}
.slider-nav-sm.slider-nav-outside-expand .slider-nav {
margin-left: -3.5rem;
margin-inline-start: -3.5rem;
}
.slider-nav-sm.slider-nav-outside-expand .slider-nav.slider-nav-next {
margin-right: -3.5rem;
margin-inline-end: -3.5rem;
}
.slider-indicators-sm.slider-indicators {
display: none;
Expand Down Expand Up @@ -535,7 +541,7 @@
content: " ";
display: block;
position: absolute;
left: calc((var(--swiffy-slider-item-gap)/2)*-1);
inset-inline-start: calc((var(--swiffy-slider-item-gap)/2)*-1);
top: 0;
/*FF fix setting w+h to 1 px - otherwise snap will not occur*/
width: 1px;
Expand Down Expand Up @@ -609,4 +615,4 @@
.slider-item-nosnap-touch {
--swiffy-slider-snap-align: unset;
}
}
}
2 changes: 1 addition & 1 deletion dist/css/swiffy-slider.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/swiffy-slider.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 84b3710

Please sign in to comment.