-
Notifications
You must be signed in to change notification settings - Fork 72
[LG-5760] chore: FormFooter Sticky Styling #3344
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: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 42ddd29 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Size Change: +94 B (+0.01%) Total Size: 1.8 MB
ℹ️ View Unchanged
|
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.
Pull request overview
This PR refactors the FormFooter component's internal DOM structure to properly support sticky positioning by separating the outer footer container from the inner content container. This separation allows the overflow shadow utility to be correctly applied to the inner container while maintaining the proper background styling on the outer element, preventing visual issues when the footer uses position: sticky.
Key Changes
- Introduced a new inner container div with
getInnerContainerStyles()that applies the overflow shadow and inherits the background from the outer footer - Moved layout styles (min-height, padding, flex properties) from the outer footer to the inner container
- Updated the Storybook stories to use named imports and added a new
StickyFooterstory demonstrating the sticky positioning use case
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
packages/form-footer/src/FormFooter.tsx |
Added new inner container div between footer and content elements; removed unused cx import; restructured DOM hierarchy to support sticky positioning |
packages/form-footer/src/FormFooter.styles.ts |
Split styles into three layers: outer footer (background, theme), inner container (layout, overflow shadow), and content (flex layout); added getInnerContainerStyles() and getContentStyles() helper functions |
packages/form-footer/src/FormFooter.stories.tsx |
Changed import from default to named export; added new StickyFooter story with sticky positioning example |
tools/install/src/ALL_PACKAGES.ts |
Added two @lg-chat packages to the package list (appears to be unrelated to FormFooter changes) |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
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.
missing changeset
| const innerContainerBaseStyle = css` | ||
| min-height: 92px; | ||
| width: 100%; | ||
| padding: 26px 24px; |
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.
Same here, can we use spacing tokens?
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.
(Also why 26px? I know that was there previously, but I don't remember why)
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.
No idea, and I also tried changing from 26px -> 24px with no visual regression, so I'll change it to 24px all around for consistency
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.
Recapping out slack convo. I confirmed with design it should be 24px all around
TheSonOfThomp
left a comment
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 missing a changeset
| /> | ||
| ); | ||
|
|
||
| const StickyTemplate: StoryType<typeof FormFooter> = ({ |
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.
If this is intended to be a chromatic snapshot, it could be made more realistic by setting overflow: hidden; on the scrolling div and making this a play test that scrolls to a fixed point before taking the snapshot. There are a couple examples of this in the Drawer stories if you search for a ScrollableAndPadded story
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.
I don't know if we necessarily need to test that the sticky behavior works on scroll, and just leave it with a test confirming that adding position: sticky; doesn't break it
|
Coverage after merging ar/LG-5760-shadow into main will be
Coverage Report for Changed Files
|
|||||||||||||||||||
✍️ Proposed changes
This PR refactors the
FormFootercomponent's internal structure to properly support sticky positioning (or prevent the overflow shadow from breaking based on additional styles added throughclassName). The changes separate the outer footer container from the inner content container, allowing the overflow shadow to be applied correctly when the footer is positioned as sticky. Previously, the shadow and background styles were applied to the same element, which caused visual issues in sticky contexts.🎟️ Jira ticket: LG-5760
✅ Checklist
pnpm changesetand documented my changes🧪 How to test changes
FormFooterStorybook stories