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 Cards] Regression in visual appearance of product card shadows #2596

Open
kjellr opened this issue May 1, 2023 · 1 comment
Open
Labels
Category: Bug Something isn't working Critical Path: 3 Affects few merchants/buyers 🎨 Design: Cards 🎨 Design: Shadows Bugs, features or enhancements related to shadow settings Severity: 3 Normal/Low Severity

Comments

@kjellr
Copy link
Contributor

kjellr commented May 1, 2023

Describe the issue

Since #2372 and #2452, we've seen a regression in the layering of shadows for product cards.

Previously, shadows with a negative horizontal offset would always appear underneath product cards. With these updates however, these shadows appear on top of the cards next to them.

Dawn 9.0 Current
Screenshot 2023-05-01 at 12 56 06 PM Screenshot 2023-05-01 at 12 55 55 PM
  • This is because when "Reveal sections on scroll" is active, the cascading CSS animation basically establishes a new stacking order, in which each new card that appears overlaps the previous card.
  • The problem also appears when the 3D hover effect is active, due to the z-index rule that's added there.

Demonstration:

01-08-7cr6d-v7nnq.mp4
@kjellr
Copy link
Contributor Author

kjellr commented May 1, 2023

Brainstorming a couple possible solutions:


1. Apply our shadows to the parent wrapper (i.e. product-grid) instead of to the actual cards.

Some light prototyping shows that this would generally work, but that it would require a bunch of refactoring and testing. We'd have to use filter: drop-shadow() instead of box-shadow, in order for the shadow to appear correctly. drop-shadow() doesn't support a spread value, but we don't use one for these shadows today anyway.

There are some visual mockups of this approach over here.


2. Set descending z-index values for each cards as they get animated in.

We could try leveraging our existing --animation-order variable to set a descending z-index for each card. For example:

[data-cascade].scroll-trigger:not(.scroll-trigger--offscreen).animate--slide-in {
  z-index: calc(5 - var(--animation-order));
 }

(I used 5 there because that’s the max number of columns you can set for product cards.).

This seems to mostly work, though we’d also need to increase the z-index values used by the 3D Lift effect so they’re greater than 5. It also runs into issues when there are multiple rows of grid items. 😕

@kimberlyoleiro kimberlyoleiro added Severity: 3 Normal/Low Severity Critical Path: 3 Affects few merchants/buyers 🎨 Design: Shadows Bugs, features or enhancements related to shadow settings 🎨 Design: Cards labels May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Bug Something isn't working Critical Path: 3 Affects few merchants/buyers 🎨 Design: Cards 🎨 Design: Shadows Bugs, features or enhancements related to shadow settings Severity: 3 Normal/Low Severity
Projects
None yet
Development

No branches or pull requests

2 participants