-
Notifications
You must be signed in to change notification settings - Fork 9.6k
report(metrics): use css grid so metrics are aligned #10695
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
Conversation
there needs to be a 😍 reaction on PRs :) |
lighthouse-core/report/html/renderer/performance-category-renderer.js
Outdated
Show resolved
Hide resolved
} | ||
.lh-metrics-container { | ||
display: grid; | ||
grid-template-rows: 1fr 1fr 1fr; |
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.
dunno a lot about grid but does this need to be repeated 3 times? what if another metric is added via custom config or w/e. do we need changes 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.
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.
another solution: interleave the creation of these lh-metric
divs such that the rendering order is good. like 1 4 2 5 3 6
...
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 other words, css grid doesnt allow for letting elements fill up a column 1 first, column 2 second, and then not create a 3rd column (what would that css even look like...)
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.
gotcha. IMO with 7 metrics it doesnt look that bad.
I'm fine with keeping the css as you have 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.
cool 🫘
.lh-column:first-of-type { | ||
margin-right: 8px; | ||
@media screen and (min-width: 640px) { | ||
.lh-metric:nth-last-child(-n+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.
fancy footwork. 🕺
This reverts commit d8d386d.
This reverts commit d8d386d.
before:
after: