-
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
[Card] Fix padding in small devices #608
Conversation
👋 Thanks for opening your first pull request. A contributor should give feedback soon. If you haven’t already, please check out the contributing guidelines. You can also join #polaris on the Shopify Partners Slack. |
5f595a1
to
8f950e1
Compare
@@ -17,11 +17,19 @@ | |||
} | |||
|
|||
.Header { | |||
padding: spacing(loose) spacing(loose) 0; | |||
padding: spacing() spacing() 0; |
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.
On https://github.com/Shopify/polaris-react-deprecated/issues/1999#issuecomment-417046795 it was discussed that side paddings should be 16px, but for top and bottom, should it still be 20px?
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.
IMO yes, but tagging in @sarahill 👋
I'm not sure what the basis for having the special breakpoint in the resource list component is, but you're using the correct mixin here 👍 |
Thanks, @chloerice! I'll wait for @sarahill's input into what the top/bottom padding should be, and update if needed. |
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.
Code and tophat are 👍
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 to me! Thanks for making this fix 💯
Thanks, @sarahill and @chloerice! I've just updated the conflicts in the Changelog. This is my first PR in Polaris, what are the next steps? |
Thanks again, @amireynoso 🎉 You're good to merge once the conflicts are resolved in UNRELEASED (it's an ever-moving target 😣). Ping me if you get any percy snapshot stuff that you're unsure of. (It's kind of cryptic, but for this PR the shift to the left of the red marks is expected) |
Hi @chloerice, thank you so much for your help! Seconds before you commented, I resolved the conflicts in the UNRELEASED doc. It made the Percy check fail again. Would you mind re-approving? I'll merge afterwards. Thanks again! 🙌 |
🎉 Thanks for your contribution to Polaris React! |
WHY are these changes introduced?
Resolves https://github.com/Shopify/polaris-react-deprecated/issues/1999
Card is supposed to have a 16px padding in small devices, as defined in the UI kit. This was causing inconsistencies when Card is used with other components that respect the 16px spacing rule [see issue for screenshots and live demo].
WHAT is this pull request doing?
Sets the current spacing rules (20px) as desktop rules using the
page-content-when-not-fully-condensed
breakpoint (already in place for Card). And sets 16px as the default value.Questions / concerns
I'm using the
page-content-when-not-fully-condensed
mixin, which was already being used in Card (breakpoint is at around 490px).However, it's not consistent to other breakpoints in components that should behave similarly, such as ResourceList (breakpoint is at 458px).
Is
page-content-when-not-fully-condensed
the right call in this case? Or should I use the same hard-coded value as ResourceList?How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Screenshots
Before fix
Notice the difference between the ResourceList spacing in the second card and the card title (mobile only).
After fix
Desktop stays the same.

Copy-paste this code in
playground/Playground.tsx
:🎩 checklist