Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Product] Fix transparent image zoom #2280

Closed
wants to merge 5 commits into from
Closed
Changes from 3 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
7 changes: 6 additions & 1 deletion assets/section-main-product.css
Original file line number Diff line number Diff line change
Expand Up @@ -1158,8 +1158,13 @@ a.product__text {
border-radius: calc(var(--media-radius) - var(--media-border-width));
}

.image-magnify-hover {
.image-magnify-full-size + img {
opacity: 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a transition in scope for opacity here. https://screenshot.click/02-22-zhx81-93cmp.mp4 We could override that or probably use visibility instead

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah coming from here, I was noticing the same:

Screenshot

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just fixed it by adding transition: none to .media>.image-magnify-hover.

  • I opted for this instead of visibility:hidden because visibility removes it from the accessibility tree.
  • Applied transition:none to .media>.image-magnify-hover instead of .image-magnify-full-size + img because in the latter, only the in transition is impacted. Once the class is removed, the out still shows up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

.media>.image-magnify-hover {
cursor: zoom-in;
transition: none;
}

.product__modal-opener--image .product__media-zoom-none,
Expand Down