-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 image banner height settings #695
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.
Thank you so much Ken!
Took a first bite at it and let's keep having a different max-height
value for all the setting options on mobile!
Here is what I had in mind for mobile:
- Small = 28rem
- Medium = 34rem
- Large = 39rem
I am continuing to investigate the info text language and the behaviour for when the setting Adapt section height to first image size
is set to true.
@@ -863,7 +876,8 @@ | |||
"label": "Show text below images" | |||
}, | |||
"adapt_height_first_image": { | |||
"label": "Adapt section height to first image size" | |||
"label": "Adapt section height to first image size", | |||
"info": "Overwrites image banner height setting when checked." |
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.
We'll keep this for now but we know that moving this setting inside the Image banner height
setting would be a better enhancement for merchants but would require a breaking change. Took a note about it over here to consider later.
ccaea9a
to
b92d99c
Compare
@melissaperreault mobile heights added, let me know how they look. I definitely think this works better than sharing the desktop values. |
Following our IRL chats, when testing the most up to date section settings including the one merged here #663, I have one last request to make to adjust the box
|
@melissaperreault Can I get some clarification on this please? I need the heights for each setting (small medium large) for desktop and mobile for the Help Center docs. |
Hey @KimliW, these are the heights for each of the setting options as it stands. The setting currently defaults to Tablet/Desktop: Mobile: |
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.
Thank you Ken! Looking real good! 🎉
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.
Looks good 👍 Added small comments
@@ -277,6 +305,12 @@ | |||
} | |||
} | |||
|
|||
@media screen and (min-width: 1400px) { | |||
.banner__box { | |||
max-width: 90rem; |
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.
Was this PR rebased? Just want to ensure this change has the up to date changes from the width PR since I see a max-width added here.
Max width added on the other PR: https://github.com/Shopify/dawn/pull/663/files#diff-8a48cf1c4c77bd24f3d47ceac2c19b0149a25b33c5e4f3d3155d249448ffdcfaR268-R272
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.
Yeah it should have been rebased onto that banner width pr. This change was a follow up to those changes for widescreens from Meli. I should have updated the pr description to mention that.
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.
Correct, combined with the changes to the height created here, I saw an opportunity to polish the final outcome combined with the other PR 👌
], | ||
"default": "medium", | ||
"label": "t:sections.image-banner.settings.image_height.label", | ||
"info": "t:sections.image-banner.settings.image_height.info" |
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 believe youll need to request translations
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.
For sure, I figure I should make sure the language added looks good to at least one dev before I request.
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 believe it looks good! :) I would confirm with @melissaperreault and @gretchen-willenberg if there are any changes that need to be made before requesting them
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.
We are good to go for now! Thanks! 🙏
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.
Couple comments but looked good to me.
} | ||
|
||
.banner--large:not(.banner--mobile-bottom):not(.banner--adapt) .banner__content { | ||
min-height: 39rem; |
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.
those could maybe be grouped with the styling declaration above on line 8, 13, 18 ?
@@ -161,10 +187,12 @@ | |||
|
|||
.banner__content--flex-start { | |||
align-items: flex-start; | |||
padding-bottom: 15rem; |
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 wonder if we would run into any odd scenarios when the image is wider than its height. It would only zoom in a little so I don't think it's an issue 🤔
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 am not sure I understand the use case @ludoboludo , do you mind testing it?
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.
You bet, here is what I mean. Video
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.
Agree with Ludo, when the "adapt" setting is enabled, the image should keep its intrinsic ratio. Unless textbox content overflows, in which case the height of the image should just grow with the textbox and the ratio will need to change.
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.
Thank you Ludo for explaining! Agreed that we are ok! 👌
Although, I am noticing something that I want to test, if I remove the box, the text and buttons should be vertically centered on the banner. I might have missed this detail during my review. 🤔
edit: 😵💫 Forget what I said! We have a setting to set the content position on the banner that I forgot for 1 minute! 😅
"options__3": { | ||
"label": "Large" | ||
}, | ||
"info": "For best results, use an image with a 2:3 aspect ratio. [Learn more](https://help.shopify.com/en/manual/shopify-admin/productivity-tools/image-editor#understanding-image-aspect-ratio)" |
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.
Also I wonder, is 2:3 the aspect ratio we recommend ? Not 3:2 ? Since this section seem to be more for landscape images rather than portraits.
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.
Good catch Ludo, Aligned with reverting the numbers to 3:2
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.
Might want to check if we did this mistake on other sections where we mention 2:3 🤔 Taking a note to look for later!
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.
Looks like featured and main blog uses the same 2:3 note. If those also should be updated, we can probably handle them all in a follow up so we don't have to re-request translations here.
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.
Aligned! And yes, they should both be 3:2
too.
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.
Sounds good 👌 Follow up PR it is. It could maybe be added on the new section for the password page as well that Sofia is working on: #698 (comment)
ae989b6
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.
🚢 🎉
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.
Looks good! Left a suggestion + comment
@@ -161,10 +187,12 @@ | |||
|
|||
.banner__content--flex-start { | |||
align-items: flex-start; | |||
padding-bottom: 15rem; |
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.
Agree with Ludo, when the "adapt" setting is enabled, the image should keep its intrinsic ratio. Unless textbox content overflows, in which case the height of the image should just grow with the textbox and the ratio will need to change.
@@ -5,25 +5,58 @@ | |||
} | |||
|
|||
@media screen and (max-width: 749px) { | |||
.banner--mobile-bottom:not(.banner--stacked):not(.banner--adapt) | |||
> .banner__media { | |||
.banner--small.banner--mobile-bottom:not(.banner--adapt) > .banner__media, |
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.
These selectors for defining height may benefit from a refactor to ensure increased code readability and avoiding selector repetition. Something like this:
.banner--adapt {
--image-banner-height: initial;
--image-banner-height-desktop: initial;
}
.banner--small {
--image-banner-height: 28rem;
--image-banner-height-desktop: 42rem;
}
.banner--medium {
--image-banner-height: 34rem;
--image-banner-height-desktop: 56rem;
}
.banner--large {
--image-banner-height: 39rem;
--image-banner-height-desktop: 72rem;
}
@media screen and (max-width: 749px) {
.banner--mobile-bottom > .banner__media,
.banner--stacked:not(.banner--mobile-bottom) > .banner__media {
height: var(--image-banner-height);
}
.banner:not(.banner--mobile-bottom) .banner__content {
min-height: var(--image-banner-height);
}
}
@media screen and (min-width: 750px) {
.banner {
flex-direction: row;
min-height: var(--image-banner-height-desktop);
}
}
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.
That's not a bad thought Kai. There may be some other code around that could benefit from a similar refactor as. I'll look into creating a cleanup PR
* Added new height settings * Update mobile height styles * Add mobile specific height values * Add wide screen max width for banner box * Update 8 translation files * Update 8 translation files * Update 1 translation file * Update 1 translation file * Update 1 translation file * Update 1 translation file Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>
Why are these changes introduced?
Fixes #552
What approach did you take?
Replaced fixed heights with setting specific values using a
banner--<size>
class.Also included a banner box width update for widescreens.
Demo links
Checklist