[go: nahoru, domu]

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

report: use css grid for metrics #9273

Merged
merged 5 commits into from
Jun 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions lighthouse-core/report/html/report-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
--header-line-height: 24px;
--highlighter-background-color: var(--report-text-color);
--icon-square-size: calc(var(--score-icon-size) * 0.88);
--metric-description-padding: 0 0 2px calc(var(--score-icon-margin-left) + var(--score-icon-size) + var(--score-icon-margin-right));
--metric-toggle-lines-fill: #7F7F7F;
--metrics-toggle-background-color: var(--color-gray-200);
--plugin-badge-background-color: var(--color-white);
Expand Down Expand Up @@ -428,7 +427,8 @@
.lh-audit--fail .lh-audit__display-text {
color: var(--color-fail-secondary);
}
.lh-audit--fail .lh-audit__score-icon {
.lh-audit--fail .lh-audit__score-icon,
.lh-audit--error .lh-audit__score-icon {
border-left: calc(var(--score-icon-size) / 2) solid transparent;
border-right: calc(var(--score-icon-size) / 2) solid transparent;
border-bottom: var(--score-icon-size) solid var(--color-fail);
Expand All @@ -444,10 +444,6 @@
background: var(--color-gray-400);
}

.lh-audit--error .lh-audit__score-icon {
display: none;
}

.lh-audit--informative .lh-audit__display-text {
color: var(--color-gray-600);
}
Expand Down Expand Up @@ -570,10 +566,9 @@
}

.lh-metric__innerwrap {
display: flex;
display: grid;
grid-template-columns: var(--audit-description-padding-left) 10fr 3fr;
align-items: center;
flex-wrap: wrap;
justify-content: space-between;
padding: 10px 0;
}

Expand All @@ -593,13 +588,15 @@

.lh-metric__description {
display: none;
grid-column-start: 2;
grid-column-end: 3;
Copy link
Member

Choose a reason for hiding this comment

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

looking at https://yuinchien.com/sandbox/lighthouse/
image

it seems this is currently misaligned...
image

perhaps:

  grid-column-start: 2;
  grid-column-end: 4;

? i dont really know grid though... can you doublecheck?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ya that did the trick

color: var(--report-text-color-secondary);
padding: var(--metric-description-padding);
}

.lh-metric__value {
white-space: nowrap; /* No wrapping between metric value and the icon */
font-weight: 500;
justify-self: end;
}

/* No-JS toggle switch */
Expand Down Expand Up @@ -694,7 +691,8 @@
.lh-metric--fail .lh-metric__value {
color: var(--color-fail-secondary);
}
.lh-metric--fail .lh-metric__innerwrap::before {
.lh-metric--fail .lh-metric__innerwrap::before,
.lh-metric--error .lh-metric__innerwrap::before {
border-left: calc(var(--score-icon-size) / 2) solid transparent;
border-right: calc(var(--score-icon-size) / 2) solid transparent;
border-bottom: var(--score-icon-size) solid var(--color-fail);
Expand All @@ -705,11 +703,6 @@
color: var(--color-fail-secondary);
}

/* Hide icon if there was an error */
.lh-metric--error .lh-metric__innerwrap::before {
display: none;
}

/* Perf load opportunity */

.lh-load-opportunity__cols {
Expand Down