From 3e492c976acbc93345fbfd66b4686be5935c8ef3 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Tue, 11 Jun 2019 17:11:25 -0700 Subject: [PATCH] report: update permalink calculations for correct hash nav scroll position --- lighthouse-core/report/html/report-styles.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lighthouse-core/report/html/report-styles.css b/lighthouse-core/report/html/report-styles.css index 62d1cb231ca9..d1752a9dc00e 100644 --- a/lighthouse-core/report/html/report-styles.css +++ b/lighthouse-core/report/html/report-styles.css @@ -39,7 +39,6 @@ --display-value-gray: hsl(216, 5%, 39%); --report-width: calc(60 * var(--body-font-size)); --report-min-width: 400px; - --report-header-height: 161px; --lh-score-icon-background-size: 24px; --lh-tools-icon-size: var(--lh-score-icon-background-size); --lh-tools-icon-color: var(--medium-75-gray); @@ -1212,8 +1211,10 @@ https://css-tricks.com/hash-tag-links-padding/ */ .lh-category > .lh-permalink { - margin-top: calc((var(--report-header-height) + var(--default-padding)) * -1); - padding-bottom: calc(var(--report-header-height) + var(--default-padding)); + --sticky-header-height: calc(var(--gauge-circle-size) + var(--score-container-padding) * 2); + --topbar-plus-header: calc(var(--topbar-height) + var(--sticky-header-height)); + margin-top: calc(var(--topbar-plus-header) * -1); + padding-bottom: var(--topbar-plus-header); display: block; visibility: hidden; }