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

fix(report): align table headings & columns left & right #6063

Merged
merged 3 commits into from
Sep 20, 2018

Conversation

wardpeet
Copy link
Collaborator

Summary
It aligns our columns & headings correctly.

This is how it looks:
https://codepen.io/wardpeet/full/zJyMGx

Related Issues/PRs
#6049

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

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

this looks awesome.

@@ -907,18 +907,23 @@ summary.lh-passed-audits-summary {
}

.lh-table-column--text,
.lh-table-column--url,
.lh-table-column--node {
text-align: left;
Copy link
Member

Choose a reason for hiding this comment

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

do we need to write this, or is it the default?

Copy link
Member

Choose a reason for hiding this comment

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

or i guess for 'td' this'll be redundant but neccessary for the 'th's?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes th center by default I could override the default th behavior

Copy link
Member

Choose a reason for hiding this comment

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

sg. lets add a comment of /* Looks unnecessary, but mostly for keeping the <th>s left-aligned */

@@ -907,18 +907,23 @@ summary.lh-passed-audits-summary {
}

.lh-table-column--text,
.lh-table-column--url,
.lh-table-column--node {
Copy link
Member

Choose a reason for hiding this comment

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

can you write a lil script that goes over an LHR and pulls out all these itemTypes? it'll be easier to assert we've accounted for all of them. :)
you could just add in a css comment here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do

Copy link
Collaborator Author

@wardpeet wardpeet Sep 20, 2018

Choose a reason for hiding this comment

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

Array.from(new Set($$('[class*="lh-table-column--"]').map(el => el.className)))

  • lh-table-column--thumbnail
  • lh-table-column--url
  • lh-table-column--bytes
  • lh-table-column--timespanMs
  • lh-table-column--ms
  • lh-table-column--text
  • lh-table-column--empty
  • lh-table-column--code
  • lh-table-column--node

Copy link
Member

@exterkamp exterkamp Sep 20, 2018

Choose a reason for hiding this comment

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

does .lh-table-column--code belong in this list?

In this table, the heading is centered, but the lh-code is left aligned:
--code

@paulirish paulirish merged commit e199eac into master Sep 20, 2018
@paulirish paulirish deleted the bug/table-layout branch September 20, 2018 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants