-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Blog layout enhancements #581
Conversation
bf2afa5
to
90ef222
Compare
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 great! I have no notes 🎉
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.
Left a few comments.
One thing not related that looks like it could be maybe be a quick fix 😬 is the share button being very wide on the article page. Unless it's fixed already on main.
@media screen and (min-width: 750px) { | ||
.blog__post:only-child { | ||
text-align: center; | ||
} | ||
} |
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 should still try and center the blog card when it's on its own 🤔 If you have only one article or decide to limit it to one, it mostly looks like it's missing a second one rather than looking ok alone.
cc: @Oliviammarcello
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.
Definitely a design decision but I don't know if we have a precedent for centering a card like that anywhere, unless full width. Centering might make it look more purposeful in some way, but I wouldn't say I'm crazy about it, personally https://screenshot.click/08-27-azpow-eji6o.png
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.
Fair it looks odd with the title of the section left aligned. Disregard my comment 👍
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 is a fair point, but I think it's fine to keep the card left aligned when there's only 1 post. We could argue that this section has less purpose when a blog has less than 2 articles in it. And also, this layout is the same for the featured collection when it only has one product. About that, I tested it and when I resize the browser window with those to sections, the alignment seems off on the tablet breakpoint. Is that intentional? If not I would suggest we investigate the issue and make the proper update. Here's a video recording to show what I mean.
And then there's another question that deserves to be asked on the UX side of things. Should we change the range picker start and stop values in the Blog post
section settings? Since 1 is not the use case we designed it for, perhaps it could start at 2
? And then I'm wondering why we don't allow to go up to 4
. You may remember @Oliviammarcello if there's a rational I'm forgetting?
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 the with the padding and spacing we had, the line length on the cards got a bit too short at 4
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.
Now that the margins are wider maybe that's no longer a problem? 🤔 @kmeleta would we be able to try adding 4?
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 the with the padding and spacing we had, the line length on the cards got a bit too short at 4
Gotcha. I think I remember having discussed that. Makes total sense. 👍
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 is quick mockup of what a 4 column blog looks like at the smallest desktop breakpoint (~990px) with all the current desktop paddings/sizes/etc. The titles seem a little squeezed to me in this case, but 4 articles on larger desktop sizes looks fine, and 4 articles on tablet or mobile is fine because they're just additional slides. If that looks reasonable enough I can definitely make that change. Let me know what you think.
Guillaume I think that tablet alignment you noticed is due to the tablet slider margins being applied even when it's not actually a slider. This should occur on tablet, when only 2 articles are displayed. I'll see if I can conditionally prevent 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.
@kmeleta I'm in favour of adding this in 🙌 Just to clarify, the blog posts slider will now start at 2 and have 3 in the middle and 4 on the right side.
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.
The limit slider has been updated to support 2-4 and I fixed the padding discrepancies on the tablet breakpoint when the slider is/isn't active. I also realized I originally forgot to update the placeholder card width.
assets/section-main-blog.css
Outdated
.blog-articles > *:nth-child(4), | ||
.blog-articles > *:last-child:nth-child(2), | ||
.blog-articles > *:last-child:nth-child(5) { | ||
.blog-articles--collage > *:nth-child(3n + 1) { |
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.
With this change, .blog-articles > *:last-child:nth-child(2)
and .blog-articles > *:last-child:nth-child(5)
aren't handled like they were before anymore: screenshot
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.
Hmm, I guess reading the ticket again, this change isn't called out for collage layout specifically, only grid. So you're probably right I may have to put this back in.
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.
Ok, I think I found a way to get those cases accounted for again without having to explicitly add a selector for 2 and 5 (or 1 and 4), which would really add up if being repeated for each size/breakpoint.
sections/main-blog.liquid
Outdated
"label": "t:sections.main-blog.settings.image_height.options__4.label" | ||
} | ||
], | ||
"default": "adapt", |
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.
default, based on the image shared by Guillaume in the issue should be small
. The Adapt to image
could be moved to the bottom as the last option to match that screenshot as well 🤷
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.
In Figma currently Adapt is on top, but it wasn't clear what was intended to be default. Figured there was a chance we'd want to play with these settings. Thoughts order and default @Oliviammarcello? Did I miss this decision somewhere?
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.
Sorry for the confusion. Let's use place Adapt at the top (it's at the top for other image settings). But let's use small as the default still 👍
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.
Now defaulting to small
@shainaraskas Pinging you on this for visibility as this change will also require small updates to help docs. |
@KimliW 🙏 |
e932539
to
7edd12a
Compare
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.
Left a couple comments but it's looking 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.
It's looking good to me 👌
I requested the translations while we wait for a second reviewer 🌐
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 looks good, tested with all browsers
62ea2a1
@melissaperreault I discussed this with @Oliviammarcello but wanted to make sure you were aligned. We realized the defaults we were using for the new main blog settings were creating somewhat unnecessary visual breaking changes. I'm changing the |
Thanks for the ping!
|
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.
Translations are in and only the default settings changed, seems 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.
LGTM 👍
c0e98df
c0e98df
to
611a4f7
Compare
* Add new layout settings to main blog * Update blog post image height settings * Prevent full width single post in featured blog section * Update featured blog limits and breakpoint cleanup * Main blog collage fix * Fix card text alignment * Update tablet page width * Change main blog defaults * Update 13 translation files * Update 7 translation files * Update 1 translation file Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>
Why are these changes introduced?
Fixes #418
What approach did you take?
Explicit image heights were added for each breakpoint/setting combination according to the design. If we were concerned about the number of lines of css this adds (and we didn't mind the heights being less fixed across viewport sizes), we may be able to use percentage based heights that were shared across at least some of the breakpoints. This could save some css.
Demo links
Checklist