Skip to content

Commit

Permalink
refactor: preview-image adaptive for touch and aspect-ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepasha419a committed Sep 2, 2024
1 parent b2d5e38 commit 44192cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
}
}

@media (max-width: 900px) {
@media (max-width: 900px) or (hover: none) {
.preview .slider {
$widthWithHeightAspectRatio: 100vw * 1.25;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
z-index: -1;
}

@media (max-width: 900px) {
@media (max-width: 900px) or (hover: none) {
.image {
&.full {
object-fit: cover;
Expand Down
10 changes: 9 additions & 1 deletion src/shared/ui/ImagesSlider/ImageSlider.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@
}
}

@media (max-width: 900px) and (min-aspect-ratio: 3/4) {
@media (max-width: 900px) and (max-aspect-ratio: 5/8) {
.slider {
.item {
object-fit: contain;
}
}
}

@media (max-width: 900px) and (min-aspect-ratio: 1) {
.slider {
.item {
object-fit: contain;
Expand Down

0 comments on commit 44192cc

Please sign in to comment.