[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: position sticky-header highlighter with css grid #9186

Merged
merged 2 commits into from
Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
report: position sticky-header highlighter with css grid
  • Loading branch information
brendankenny committed Jun 11, 2019
commit c8066ca36223116a93ab4a014ed619e582eb0564
5 changes: 2 additions & 3 deletions lighthouse-core/report/html/renderer/report-ui-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,8 @@ class ReportUIFeatures {
this.scoreScaleEl = this._dom.find('.lh-scorescale', this._document);
this.stickyHeaderEl = this._dom.find('.lh-sticky-header', this._document);

// Position highlighter at first gauge; will be transformed on scroll.
const firstGauge = this._dom.find('.lh-gauge__wrapper', this.stickyHeaderEl);
this.highlightEl = this._dom.createChildOf(firstGauge, 'div', 'lh-highlighter');
// Highlighter will be absolutely positioned at first gauge, then transformed on scroll.
this.highlightEl = this._dom.createChildOf(this.stickyHeaderEl, 'div', 'lh-highlighter');
}

/**
Expand Down
7 changes: 5 additions & 2 deletions lighthouse-core/report/html/templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@
}

.lh-sticky-header--visible {
display: flex;
display: grid;
grid-auto-flow: column;
pointer-events: auto;
}

Expand All @@ -204,8 +205,10 @@
width: var(--score-container-width);
height: 1px;
background: var(--color-highlighter-bg);
/* Position at bottom of first gauge in sticky header. */
position: absolute;
bottom: -5px;
grid-column: 1;
bottom: 0;
}

.lh-gauge__wrapper:first-of-type {
Expand Down