-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Padded layout for components in storybook by default #6771
Conversation
size-limit report 📦
|
<style> | ||
.sb-show-main.sb-main-padded { | ||
padding: 0; | ||
} | ||
</style> |
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.
@kyledurand this felt like something that could be cleaned up. Let me know what you think about this PR. The other option is to make all components use layout: fullscreen
by default and we could remove this and keep everything as is.
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've not tested this to prove the layout works but I think conceptually it makes sense to keep the default of padded
layout, and explicitly opt particular stories to be fullscreen
. Having that extra indent makes it see things like drop shadows on the top edge of an element.
I put a note inline about how we could leverage the classes than the layout prop sets on the body to determine if any extra padding is needed instead of needing the Grid component to have an additional property.
See https://storybook.js.org/docs/react/configure/story-layout for context about the layout parameter
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.
This looks good but I do like Ben's suggestion of a purely css approach. Might be slightly tough to manage that for centered layouts. Those wouldn't likely work with the grid overlay anyway though
Yeah I'm fine with punting on centered layouts, and having the grid on them act the same as the fullscreen style grid. We don't have anything that uses the centered layout anyway. |
No description provided.