Skip to content
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

Add bottom padding to cart subtotal section #2779

Merged
merged 7 commits into from
Jul 12, 2023

Conversation

lougoncharenko
Copy link
Contributor

@lougoncharenko lougoncharenko commented Jul 6, 2023

PR Summary:

Cart subtotal section has padding bottom and padding top presets

Why are these changes introduced?

Fixes #2363 .

What approach did you take?

I added a preset for padding bottom in the schema and then realized that the padding top was hard-coded to be at 4rem. I added the padding top preset to this PR because I thought if a merchant has the ability to customize the bottom, they should be able to customize the top in case they want both paddings to be symmetrical or unique.

Other considerations

Visual impact on existing themes

Merchants can customize their subtotal section

Testing steps/scenarios

  • Test in mobile, tablet, desktop
  • Test on different browsers (safari, chrome, mozilla)
  • Try different padding sizes on both top and bottom
  • Add more blocks in the section

Demo links

Checklist

@lougoncharenko lougoncharenko linked an issue Jul 6, 2023 that may be closed by this pull request
@lougoncharenko lougoncharenko requested review from kjellr and kmeleta July 6, 2023 12:51
Copy link
Contributor

@kjellr kjellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well in my testing, thank you!

@lougoncharenko lougoncharenko requested a review from ludoboludo July 6, 2023 15:06
Copy link
Contributor

@ludoboludo ludoboludo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment but the rest looks good 👍

@lougoncharenko lougoncharenko requested a review from ludoboludo July 6, 2023 15:45
Copy link
Contributor

@KaichenWang KaichenWang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! this will be really useful for merchants!

One thing I noticed is that the cart note heading is positioned within the top padding.

Screenshot 2023-07-11 at 10 57 13 AM png2

@@ -78,7 +74,7 @@ cart-items {
}

.cart__footer > * + * {
margin-top: 4rem;
margin-top: 6.5rem;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be ok, but I'm not sure if apps can inject elements into the cart footer and will inherit this additional margin too. So it may be safer to only target elements that directly follow the cart note in the DOM:

@media screen and (max-width: 749px) {
  .cart__note + * {
    margin-top: 6.5rem;
  }
}

@lougoncharenko lougoncharenko merged commit 8fe4e3c into main Jul 12, 2023
@lougoncharenko lougoncharenko deleted the add-bottom-padding-to-cart-subtotal-section branch July 12, 2023 14:13
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
* added padding top and padding bottom to cart subtotal

* removed styling that were interfering with customizable padding

* changed the calculations to reflect other sections

* applied changes from code review

* changed default to 40px

* applied changes suggested in code review

* added extra padding for mobile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cart] Subtotal section is missing bottom padding
5 participants