-
Notifications
You must be signed in to change notification settings - Fork 685
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
Set fixed min-height on main page #2942
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.
@@ -12,7 +12,8 @@ | |||
.page { | |||
margin: 0 auto; | |||
max-width: var(--venia-global-maxWidth); | |||
min-height: 100vh; | |||
min-height: 40rem; |
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 much more palatable than 100vh :) Nice and simple.
@@ -12,7 +12,8 @@ | |||
.page { | |||
margin: 0 auto; | |||
max-width: var(--venia-global-maxWidth); | |||
min-height: 100vh; | |||
min-height: 40rem; | |||
padding: 1rem 0 1.5rem; |
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.
Bringing back the footer into view does cause quite a bit of jumping around on any pages that load content async like product and categories - https://pr-2942.pwa-venia.com/venia-tops/venia-blouses.html?page=1 which will affect Cumulative Layout Shift negatively https://web.dev/cls/ |
Yes, very good point. This highlights how problematic it is to async-load content without placeholders that allow layout to pre-allocate space for that content. Lighthouse does and should call this out, and we do need to address it. |
Devil's advocate though — loading skeletons almost always have CLS too. They just never seem to be content-shaped enough to perfectly avoid it. Yeah Google wants you to avoid it, but can anyone without SSR? This just feels like one of those "a real project would never allocate resources to fixing it when the backlog has 200 tickets" areas. |
@@ -10,9 +10,10 @@ | |||
} | |||
|
|||
.page { | |||
display: grid; |
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 true, but CLS measures how much layout shift, so even an imperfect skeleton is better than none. That said, it's also true that layout shift will continue to be a problem until we land SSR. Because routing information is stored on the server rather than the client, we can't even render a meaningful skeleton until Accordingly, I've stripped this PR down to the essential bugfix and nothing more. |
@jimbo Looks good. Just a query when page content is very less, should there be max height? |
Should be fine as it is. |
QA Approved. |
Description
The
Main
component, which renders the header, page, and footer, setsmin-height: 100vh
on the page. As intended, this style prevents the footer from ever appearing above the fold. Unfortunately, setting a height with relative units causes issues when the page is rendered in an<iframe>
, so we'll have to remove it.This PR changes to
min-height: 40rem
(640px
) and addresses any fallout from that change.Related Issue
PWA-1243.
Acceptance
Verification Stakeholders
Specification
Verification Steps
640px
below the header./cart
,/checkout
, and other pages.640px
below the header.Screenshots / Screen Captures (if appropriate)
Checklist