[go: nahoru, domu]

Skip to content

Commit

Permalink
report: position sticky-header highlighter with css grid (#9186)
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny authored and paulirish committed Jun 11, 2019
1 parent 233f197 commit 7bcd1b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
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: -1px;
}

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

0 comments on commit 7bcd1b4

Please sign in to comment.