-
Notifications
You must be signed in to change notification settings - Fork 201
fix(popover): restores drop shadow for nested popovers #3965
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
base: spectrum-two
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 18bb2cb The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🚀 Deployed on https://pr-3965--spectrum-css.netlify.app |
File metricsSummaryTotal size: 1.42 MB*
popover
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
2d298d9
to
82fb626
Compare
4da178a
to
c6952ec
Compare
c0904af
to
96642fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just putting some of our conversation here for posterity:
I think I agree with you that React's implementation isn't quite what we're looking for. That feels like a much larger refactor, to pull the action menu out of our current markup, just so that it's not part of the "double shadow" thing. If i'm remembering correctly, the shadow on the popover was initially built with filter: drop-shadow(all the drop shadow values..) because we need to incorporate the lil' triangle when popovers have a tip, like the shadow has to follow that weird popover+triangle shape. Otherwise, React's box-shadow doesn't work on it, and doesn't follow the tip shape.

All that being said....if we completely remove that nested popover filter mod, we do end up with double shadows being built. the second screenshot is the nested story on the popover page. This one feels really visible to me- less visible than the one on the action menu in coach mark.

So what if instead, we opt for using box-shadow most of the time, but then move the filter style just to popover-with-tip.


This is a tough one. I'd still want someone from design to take a peek since the box shadow and the filter drop shadow definitely look different 😅 My untrained eyes say the box-shadow actually looks closer to the Figma shadow, but it also feels weird to use box-shadow
on some popovers, and filter
on others. 🤦♀️
My first thought is to refactor the filter
at line 72 to use box-shadow
instead. That would give us the comparison for popovers with a tip (using filter) and popovers without the tip (box-shadow)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another note for posterity:
The box shadow (pink) renders smaller than the filter: drop-shadow() (green). However, the box shadow looks to match the Figma drop shadow better- this is where I'd need to get with a designer to ask which they like better. The values are identical for X, Y, blur, and color, but:
- the box-shadow and filter: drop-shadow() use different blur algorithms. 🤦♀️
- Apparently, there's also an extra compositing layer with filter: drop-shadow(), which can affect how the blur spreads. 🤦♀️
- Maybe there's some bounding container fudging going on which may make the blur extend further. I wonder if the filter is considering the tip as "part" of bounds, and is pretty much adding 8 extra pixels to the bounding container when it shouldn't really, giving the illusion of a larger, softer drop-shadow.
I had everything in dark mode to try to see the shadows better.

📚 Branch previewPR #3965 has been deployed to Azure Blob Storage: https://spectrumcss.z13.web.core.windows.net/pr-3965/index.html. |
c0ad3eb
to
9934091
Compare
9934091
to
18bb2cb
Compare
@@ -69,12 +74,14 @@ | |||
border-width: var(--mod-popover-border-width, var(--spectrum-popover-border-width)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Custom property --spectrum-popover-border-width not defined
Description
CSS-1066
Restores drop shadow for nested popovers.
Per design and the coach mark component in our Figma library, nested popovers should have drop shadows enabled.
Screenshots
To-do list