fix(components): Remove doubled shadow on SideDrawer #2933
Merged
Aiden-Brine merged 1 commit intomasterfrom Mar 2, 2026
Merged
fix(components): Remove doubled shadow on SideDrawer #2933Aiden-Brine merged 1 commit intomasterfrom
Aiden-Brine merged 1 commit intomasterfrom
Conversation
bea6d9b to
8af013d
Compare
Deploying atlantis with
|
| Latest commit: |
8af013d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://41b5e2df.atlantis.pages.dev |
| Branch Preview URL: | https://job-153152-sidedrawer.atlantis.pages.dev |
Contributor
Contributor
|
ah one thing I should have mentioned is, does this show up in a visual test? I see we have a test for SideDrawer. unclear if it has the right conditions, and if the double shadow either didn't trigger a big enough diff, or maybe it's not showing up for some reason. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivations
Here's a PR description based on everything we explored:
fix(components): Remove doubled shadow on SideDrawer header and footer
When the SideDrawer contains scrollable content, a scroll-position shadow is applied to both the header (shadow below) and footer (shadow above) to visually indicate that content is hidden behind them. However, these shadows were also bleeding outside the drawer to the left, creating a doubled shadow alongside the drawer's own elevation shadow.
This happened because
box-shadowon a child element is not clipped to its parent's bounds. The.containerelement carries the drawer's overall elevation shadow (--shadow-base), and when the header/footer received their ownbox-shadow: var(--shadow-base), that shadow also painted leftward outside the drawer — on top of the existing elevation shadow.The footer had a custom
box-shadowoverride, but it still bled due to its12pxblur radius spreading in all directions, including leftward.Both the standard (fixed) and
inlinevariants were affected.Added
Added
overflow: clipto.container:This clips any descendant paint that extends outside the container's bounds, preventing the header and footer shadows from bleeding outside the drawer. The container's own
box-shadow(the elevation shadow) is unaffected,overflowonly clips descendants, not the element's own paint.Why
overflow: clipand notoverflow: hiddenoverflow: hiddencreates a scroll container, which breaksposition: stickyon descendant elements. Both the header and footer rely onposition: stickyto stay anchored at the top and bottom of the drawer. Usingoverflow: hiddenwould cause them to scroll away with the content.overflow: clipwas introduced specifically to address this. It clips descendant overflow paint without creating a scroll container, soposition: stickycontinues to work correctly.overflow: clipis well-supported in all browsers we target (Chrome 90+, Firefox 81+, Safari 16+).Potential side effects I explored
Focus rings (
--shadow-focus)Focus rings in this design system are implemented as
box-shadowwith a 4px spread. Any focused element near the container's left edge could have its focus ring clipped. However the.contentdiv already hasoverflow-y: auto, which per the CSS spec promotesoverflow-x: visibletoautoas well. So focus rings were already being clipped by.content's overflow for any element at the left edge.overflow: clipon.containerchanges nothing here.Inline dropdown components (
MultiSelectandDataListItemActions)These components render their floating UI inline in the DOM (no portal). It is the same story as focus rings ,
.content'soverflow-y: autowas already clipping them.overflow: clipon.containerintroduces no new behaviour for anything inside.content.Portalled components (everything else)
Combobox,Menu,Autocomplete,Popover,Tooltip,Modal,LightBox,Toast,DatePickerandDataListActionsMenuall portal their floating UI todocument.body. They are completely unaffected.Testing
Open Storybook and navigate to Components → Overlays → SideDrawer → Web.
Shadow fix — Open the Basic story (which has a footer). Scroll the content so the header and footer shadows appear. Check the left edge of the drawer: there should be a single clean shadow, not a doubled/intensified one.
Header shadow only — Open any story without a footer and scroll down. Same check on the header's left edge.
Inline variant — Open the Inline story. Scroll the content and check both the header and footer shadow edges.
Sticky header/footer — Confirm the header and footer remain sticky (don't scroll away with content) in any story with scrollable content.
Both the standard (fixed) and inline variants were affected.
Changes can be
tested via Pre-release
In Atlantis we use Github's built in pull request reviews.