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: fix sticky table if no sticky header #15666

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
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
18 changes: 13 additions & 5 deletions report/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
--snippet-color: #0938C2;
--stackpack-padding-horizontal: 10px;
--sticky-header-background-color: var(--report-background-color);
--sticky-header-buffer: calc(var(--topbar-height) + var(--sticky-header-height));
--sticky-header-height: calc(var(--gauge-circle-size-sm) + var(--score-container-padding) * 2);
--sticky-header-buffer: var(--topbar-height);
--sticky-header-height: calc(var(--gauge-circle-size-sm) + var(--score-container-padding) * 2 + 1em);
--table-group-header-background-color: #EEF1F4;
--table-group-header-text-color: var(--color-gray-700);
--table-higlight-background-color: #F5F7FA;
Expand Down Expand Up @@ -271,6 +271,10 @@
--section-padding-vertical: 8px;
}

.lh-container:has(.lh-sticky-header) {
--sticky-header-buffer: calc(var(--topbar-height) + var(--sticky-header-height));
}

.lh-container:not(.lh-topbar + .lh-container) {
--topbar-height: 0;
--sticky-header-height: 0;
Expand All @@ -295,7 +299,11 @@
overflow-y: scroll;
height: calc(100% - var(--topbar-height));
/** The .lh-container is the scroll parent in DevTools so we exclude the topbar from the sticky header buffer. */
--sticky-header-buffer: calc(var(--sticky-header-height));
--sticky-header-buffer: 0;
}
.lh-devtools .lh-container:has(.lh-sticky-header) {
/** The .lh-container is the scroll parent in DevTools so we exclude the topbar from the sticky header buffer. */
--sticky-header-buffer: var(--sticky-header-height);
}
@media print {
.lh-devtools .lh-container {
Expand Down Expand Up @@ -1369,7 +1377,7 @@
max-width: var(--report-content-max-width);
margin: 0 auto;

scroll-margin-top: var(--sticky-header-buffer);
scroll-margin-top: calc(var(--sticky-header-buffer) - 1em);
}

.lh-category-wrapper {
Expand Down Expand Up @@ -1460,7 +1468,7 @@

.lh-table thead th {
position: sticky;
top: calc(var(--sticky-header-buffer) + 1em);
top: var(--sticky-header-buffer);
z-index: 1;
background-color: var(--report-background-color);
border-bottom: 1px solid var(--report-border-color-secondary);
Expand Down
2 changes: 1 addition & 1 deletion report/assets/templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
border-bottom: 1px solid var(--color-gray-200);
padding-top: var(--score-container-padding);
padding-bottom: 4px;
z-index: 1;
z-index: 2;
pointer-events: none;
}

Expand Down
4 changes: 2 additions & 2 deletions report/renderer/components.js

Large diffs are not rendered by default.

Loading