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: update table and inline code formatting #10437

Merged
merged 4 commits into from
Mar 30, 2020
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
22 changes: 18 additions & 4 deletions lighthouse-core/report/html/report-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
--scorescale-width: 18px;
--section-padding-vertical: 12px;
--snippet-background-color: var(--color-gray-50);
--snippet-color: var(--color-gray-800);
--snippet-color: #0938C2;
Copy link
Member

Choose a reason for hiding this comment

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

should this be pulled out into a new color variable or does it not matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. The color isn't one of the Material Design colors so I didn't think it needed it's own variable.

Copy link
Collaborator

@connorjclark connorjclark Mar 10, 2020

Choose a reason for hiding this comment

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

yeah this is cool

--sparkline-height: 5px;
--stackpack-padding-horizontal: 10px;
--sticky-header-background-color: var(--report-background-color);
Expand Down Expand Up @@ -187,6 +187,7 @@
--report-text-color-secondary: var(--color-gray-400);
--report-text-color: var(--color-gray-100);
--topbar-background-color: var(--color-gray);
--snippet-color: var(--color-cyan-500);

/* SVGs */
--plugin-icon-url: var(--plugin-icon-url-dark);
Expand Down Expand Up @@ -413,9 +414,9 @@
/* Node */
.lh-node__snippet {
font-family: var(--report-font-family-monospace);
color: var(--color-teal-600);
font-size: 12px;
line-height: 1.5em;
color: var(--snippet-color);
font-size: 14px;
line-height: 20px;
}

/* Score */
Expand Down Expand Up @@ -498,6 +499,11 @@
flex: 1;
}

.lh-audit__title-and-text code {
color: var(--snippet-color);
font-size: 15px;
}

/* Prepend display text with em dash separator. But not in Opportunities. */
.lh-audit__display-text:not(:empty):before {
content: '—';
Expand Down Expand Up @@ -1339,6 +1345,10 @@
padding-right: 0;
}

.lh-table tr {
vertical-align: baseline;
Copy link
Member

Choose a reason for hiding this comment

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

it seems like this could get us in trouble applying to all table trs--maybe there's a specific case we've been depending on the current behavior?--but I couldn't find any bad tables in the sample_v2 report so SGTM :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did the same and couldn't find a place where a table is affected negatively. If it becomes an issues, I can always come back and make the formatting more specific.

}

/* Looks unnecessary, but mostly for keeping the <th>s left-aligned */
.lh-table-column--text,
.lh-table-column--source-location,
Expand Down Expand Up @@ -1369,6 +1379,10 @@
min-width: 250px;
}

.lh-table-column--text {
min-width: 80px;
}

/* Keep columns narrow if they follow the URL column */
/* 12% was determined to be a decent narrow width, but wide enough for column headings */
.lh-table-column--url + th.lh-table-column--bytes,
Expand Down