-
Notifications
You must be signed in to change notification settings - Fork 214
docs(fuselage): prevent horizontal overflow of Docs Args table on mobile #1796
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?
docs(fuselage): prevent horizontal overflow of Docs Args table on mobile #1796
Conversation
|
|
|
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 fixes a mobile responsive layout issue in Storybook documentation pages where the Args/Props table causes horizontal overflow of the entire page. The solution adds a scoped CSS rule that makes only the table's parent container horizontally scrollable, preserving the proper layout on mobile devices.
Key Changes
- Added a new SCSS file with a CSS rule targeting the Args table wrapper using the
:has()pseudo-class - Imported the SCSS file in the Storybook preview configuration to apply globally to all Docs pages
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/fuselage/.storybook/preview.tsx |
Added import for the new docs-overrides.scss file to apply global Docs styling |
packages/fuselage/.storybook/docs-overrides.scss |
New file containing CSS rule to make Args table container scrollable on overflow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9c5408b to
f993d8f
Compare
f993d8f to
e557b03
Compare
e557b03 to
0440ae8
Compare
|
Hi @tassoevan I have ensured all checks are passing and the branch is up to date. Please let me know if any further changes are required. Thanks! |
Proposed changes (including videos or screenshots)
This PR fixes an issue where the Args/Props table inside the Storybook Docs view overflows horizontally on mobile viewports.
On smaller screens, some table cells (for example union types, generic types, and the controls column) force the table to exceed the viewport width. Since the table is not wrapped in a scrollable container, the entire Docs page becomes horizontally scrollable instead of just the table, which breaks the mobile layout.
To fix this, a scoped CSS rule is added so that only the direct wrapper of the Args/Props table becomes horizontally scrollable:
This rule is applied globally through the Storybook Docs layer (.storybook/preview.js), so it reliably affects all component Docs pages without requiring changes to individual component stories.
Result:
Before (bug):
After (fix):
Issue(s)
closes : #1795
Further comments
On mobile, an even better UX might be to render the Args/Props information as an accordion instead of a wide table, so that each prop can be expanded/collapsed individually. That would require customizing how the Storybook Docs addon renders the Args table, so this PR focuses only on the minimal and safe CSS fix for the current layout.