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

[PDP] Fixing whitespace issue for blocks #2107

Merged
merged 3 commits into from
Dec 5, 2022
Merged

Conversation

eugenekasimov
Copy link
Contributor

@eugenekasimov eugenekasimov commented Nov 8, 2022

PR Summary:

  • removed padding-top for Icon-with-text
  • made height: 44px for share button
  • add margin-top and -bottom 2.5rem for Icon-with-text

Why are these changes introduced?

Fixes #2064 .

What approach did you take?

  • for share-button I changed height.
  • to change margin for Icon-with-text I reused an existing rule and just add the extra condition .product__info-container .icon-with-text

Other considerations

Visual impact on existing themes

Before Screenshot 2022-11-14 at 12 56 48 PM Screen Shot 2022-11-07 at 4 57 34 PM
After Screenshot 2022-11-14 at 12 50 18 PM Screen Shot 2022-11-07 at 4 53 09 PM

Testing steps/scenarios

  • Step 1

Demo links

Checklist

@YoannJailin
Copy link

YoannJailin commented Nov 11, 2022

Hi @eugenekasimov, i think we did good to remove the extra green margin.
If i understand the current logic, there is a 1.5 em margin between every block. But there is an exception : Description has a increase top and bottom margin set to 2.5 em. Is that right?

I feel like the icon with text block is a bit stuck. Would that be possible to set the same exception we have on description, on icon with text block? Meaning its top and bottom spacing would automatically be 2.5 em?

This is highly theory so happy to huddle about it before you start doing anything :)

@YoannJailin
Copy link

It looks amazing! Thanks @eugenekasimov

YoannJailin
YoannJailin previously approved these changes Nov 14, 2022
@eugenekasimov eugenekasimov marked this pull request as ready for review November 14, 2022 22:54
@ludoboludo ludoboludo self-assigned this Nov 15, 2022
@ludoboludo ludoboludo self-requested a review November 15, 2022 21:19
assets/base.css Outdated Show resolved Hide resolved
@@ -322,7 +322,8 @@ fieldset.product-form__input .form__label {
}

.product__info-container .product-form,
.product__info-container .product__description {
.product__info-container .product__description,
.product__info-container .icon-with-text {
margin: 2.5rem 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not this line affecting it but .accordion are also getting a margin-top: 2.5rem; which is ok when they're after the product description or icon with text but otherwise it might look uneven. Have a look at this example:

Screenshot

Would we maybe want to make that 1.5rem for .accordion on the product page 🤔
I guess this is more of a design decision -> cc: @YoannJailin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey Ludo, I think it's a good idea, thanks. I tested different combinations, seems like this was the only edge case.

I also noticed that the variant-picker block has only margin-bottom: 1.2rem. It's hard to reproduce a scenario to see this because usually this block is somewhere in the middle and there is a margin from other blocks. However, to keep consistency in the code I would change it to 1.5rem for top and bottom? Any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@YoannJailin I think we need your opinion here. Feel free to pair with me on it if you need to see more examples of all of this.

Choose a reason for hiding this comment

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

@ludoboludo @eugenekasimov i think i would not touch accordion's padding in this PR.

  • I don't see a merchant using blocks between collapsible row blocks. They were designed to be put together. That usecase seem a bit too specific to be worth solving for now. As this PR was just to fix the new Icon with text block, I propose we don't touch the rows for now so we can this one.

@@ -967,7 +968,7 @@ a.product__text {
font-size: 1.6rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar thing here. The product-popup-modal__opener is getting a display: inline-block above. Due to it, there is quite a bit of space around it:

Screenshot

If we were to just change the CSS to display: block; for it it would fix it 👍 :

Screenshot, after

Basically it allows for margin collapse to happen and make everything a bit tighter/neater (margin collapse explained).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm 🤔, what if a merchant wants to add two pop-up links next to each other? If we change a display to block they are not going to be in line anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh interesting, never realized that people might do that. Though I wonder how many would and if we have leveraged this in our themes so far 🤔
Another place where we could use @YoannJailin's input

Choose a reason for hiding this comment

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

I agree the spacing is not working. There's definitely extra margins around pop up link compared to the other blocks. Talking with @eugenekasimov and it seems that this would take more time to fix it. I can open another PR we could prioritize for later.

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.

This looks good then 👍

@eugenekasimov eugenekasimov merged commit 0ea3e27 into main Dec 5, 2022
@eugenekasimov eugenekasimov deleted the pdp-whitespace-blocks branch December 5, 2022 19:40
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
* Remove padding-top for icon-with-text. Add default height for share-button.

* Add margin for icon-with-text block

* Change height to min-height and width to min-width.
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.

Product page main section - Whitespace in blocks
4 participants