Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Fix the product page slider on mobile #231

Merged
merged 5 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions assets/product.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@
margin: 0;
}
}
@media (max-width: 768px) {
.yc-single-product .product-images .product-images-container .splide__slide {
width: 100% !important;
}
}
@media (max-width: 768px) {
.yc-single-product .product-images .product-images-container .splide__list {
flex-direction: column;
}
}
.yc-single-product .product-images .product-images-container .splide__arrow {
width: 16px;
height: 16px;
Expand Down
2 changes: 1 addition & 1 deletion snippets/single-product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const desktopSlider = new Splide(`#yc_slider_{{ uniqID }}.yc-slider__desktop`, {
});

desktopSlider.on('mounted', () => {
if (products >= 3 && window.innerWidth < 1024 || products > 4) {
if (products >= 3 && window.innerWidth < 1024 || products >= 4) {
document.querySelector('.yc-slider__desktop').style.padding = '0 40px';
}

Expand Down
10 changes: 10 additions & 0 deletions styles/product.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@
height: 100% !important;
margin: 0;
}

@include max-screen('md') {
width: 100% !important;
}
}

.splide__list {
@include max-screen('md') {
flex-direction: column;
}
}

.splide__arrow {
Expand Down