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(stacking-context): fix stacking contexts of elements in header #5185

Merged
merged 1 commit into from
May 11, 2018
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
2 changes: 2 additions & 0 deletions lighthouse-core/report/html/renderer/report-ui-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ class ReportUIFeatures {
scoresContainer.style.marginBottom = `${delta}px`;
this.toolbar.style.transform = `translateY(${headerTransitionHeightDiff *
animateScrollPercentage}px)`;
this.exportButton.parentElement.style.transform = `translateY(${headerTransitionHeightDiff *
animateScrollPercentage}px)`;
this.exportButton.style.transform = `scale(${1 - 0.2 * animateScrollPercentage})`;
// start showing the productinfo when we are at the 50% mark of our animation
this.productInfo.style.opacity = this.toolbarMetadata.style.opacity =
Expand Down
7 changes: 7 additions & 0 deletions lighthouse-core/report/html/report-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,13 @@
z-index: 2;
will-change: transform;
}
.lh-header-container {
display: block;
margin: 0 auto;
max-width: var(--report-content-width);
position: relative;
word-wrap: break-word;
}

.lh-report {
background-color: #fff;
Expand Down
47 changes: 21 additions & 26 deletions lighthouse-core/report/html/templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,12 @@
margin-right: var(--default-padding);
}
.lh-toolbar {
height: 50px;
position: absolute;
top: 0;
width: 100%;
will-change: transform;
}
.lh-toolbar .lh-container {
position: relative;
height: 50px;
}
.lh-toolbar__metadata {
left: 50%;
transform: translate(-50%, -50%);
Expand All @@ -190,13 +187,15 @@
display: block;
white-space: nowrap;
font-size: 14px;
margin-right: 2px;
}
.lh-export {
position: absolute;
right: var(--section-indent);
transform: translateY(-50%) scale3d(1, 1, 1);
top: 50%;
transform: translateY(0);
top: calc(var(--section-padding) / 2);
will-change: transform;
z-index: 2;
}
.lh-export__button {
background-color: #fff;
Expand All @@ -209,6 +208,7 @@
background-repeat: no-repeat;
background-size: 20px;
background-position: 50% 50%;
will-change: transform;
}
.lh-export__button:focus,
.lh-export__button.active {
Expand Down Expand Up @@ -329,8 +329,8 @@
<div class="lh-header-bg"></div>
<div class="lh-lighthouse"><svg width="217" height="189" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path id="a" d="M0 0h284v202H0z"/><linearGradient x1="0%" y1="50%" x2="93.17%" y2="50%" id="c"><stop stop-color="#F1F3F4" offset="0%"/><stop stop-color="#FFF" offset="100%"/></linearGradient></defs><g transform="translate(-56 -13)" fill="none" fill-rule="evenodd"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><g mask="url(#b)"><g transform="translate(56 70)"><path fill="#EC5548" d="M95 31h24v2H95z"/><path fill="#FBC21B" d="M98 33h18v11H98z"/><path fill="#EC5548" d="M95 43h24v7H95z"/><path fill="#FFF" d="M97.63 50h19.74L120 97H95z"/><path d="M107 22a10 10 0 0 1 10 10v1H97v-1a10 10 0 0 1 10-10zM96.77 66.23l20.97-10.7.63 11.87-22.28 11.87zM95 94.8L119.1 82l.9 14H95z" fill="#EC5548"/><path d="M0 132a177.07 177.07 0 0 1 108.5-37c40.78 0 78.38 13.78 108.5 37H0z" fill="#E8EAED"/><rect fill="#FEF0C8" x="98" y="33" width="10" height="10" rx="5"/><path fill="url(#c)" d="M7 0l91 33.18v10.05L7 77z"/></g></g><g mask="url(#b)" fill="#FFF"><g transform="translate(96 86)"><circle cx="87.5" cy=".5" r="1"/><circle cx="86" cy="20" r="1"/><circle cx="96" cy="40" r="1"/><circle cx="27" cy="68" r="1"/><circle cx="15" cy="44" r="1"/><circle cx="127" cy="64" r="1"/><circle cx="109.5" cy="44.5" r="1"/><circle cx="14.5" cy="54.5" r="1"/><circle cx="8.5" cy="57.5" r="1"/><circle cx=".5" cy="78.5" r="1"/><circle cx="27.5" cy="39.5" r="1"/><circle cx="134.5" cy="41.5" r="1"/><circle cx="97.5" cy="65.5" r="1"/><circle cx="161.5" cy="69.5" r="1"/></g></g><g mask="url(#b)" fill="#FFF"><path d="M101.2 34H70.21A7.42 7.42 0 0 1 69 29.91a7.31 7.31 0 0 1 8.54-7.26v-.11c0-5.27 4.2-9.54 9.39-9.54a9.44 9.44 0 0 1 9.24 7.83 7.24 7.24 0 0 1 7.83 7.35 7.4 7.4 0 0 1-2.8 5.82zM193.53 54h-17.9a4.3 4.3 0 0 1-.63-2.25 4.2 4.2 0 0 1 4.88-4.18v-.07c0-3.04 2.4-5.5 5.36-5.5a5.4 5.4 0 0 1 5.28 4.51l.33-.01a4.2 4.2 0 0 1 4.15 4.25c0 1.3-.57 2.47-1.47 3.25zM219.01 116h-24.16a5.1 5.1 0 0 1-.85-2.81c0-2.94 2.5-5.31 5.6-5.31.33 0 .67.02.99.08v-.08c0-3.8 3.24-6.88 7.24-6.88a7.15 7.15 0 0 1 7.13 5.64l.44-.02c3.1 0 5.6 2.38 5.6 5.32a5.2 5.2 0 0 1-1.99 4.06z"/></g></g></svg></div>

<div class="lh-header">
<div class="lh-container">
<div class="lh-header-container">
<div class="lh-header">
<div class="lh-metadata">
<div class="lh-metadata__results"><a href="" class="lh-metadata__url" target="_blank" rel="noopener"></a></div>
<div class="lh-config">
Expand Down Expand Up @@ -359,18 +359,14 @@
</div>
</div>
</div>
</div>

<div class="lh-scores-wrapper">
<div class="lh-container">
<div class="lh-scores-wrapper">
<div class="lh-scores-container">
<div class="lh-scores-wrapper__shadow"></div>
</div>
</div>
</div>

<div class="lh-toolbar">
<div class="lh-container">
<div class="lh-toolbar">
<div class="lh-product-info">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAADjklEQVR4AWI08P/HQEvAQrxSQKvlECfLFYXx75xCY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vyrOmVD0FbAXokcT48r+xVqLKvuJYbmpNadnlp3mpufJHOe/GXktM+r09bT8kEdq9BRYAbGSgzP7ll82U71Mc+ZFooXgwAAAABJRU5ErkJggg==" alt="" class="lh-product-info__icon" />
<span class="lh-product-info__name">Lighthouse</span>&nbsp;
Expand All @@ -381,21 +377,20 @@
<a href="" class="lh-toolbar__url" target="_blank" rel="noopener"></a>
<span class="lh-toggle-arrow" title="See report's runtime settings"></span>
</div>
</div>

<div class="lh-export">
<button class="report-icon report-icon--share lh-export__button" title="Export report"></button>
<div class="lh-export__dropdown">
<a href="#" class="report-icon report-icon--print" data-action="print-summary">Print Summary</a>
<a href="#" class="report-icon report-icon--print" data-action="print-expanded">Print Expanded</a>
<a href="#" class="report-icon report-icon--copy" data-action="copy">Copy JSON</a>
<a href="#" class="report-icon report-icon--download" data-action="save-html">Save as HTML</a>
<a href="#" class="report-icon report-icon--download" data-action="save-json">Save as JSON</a>
<a href="#" class="report-icon report-icon--open lh-export--viewer" data-action="open-viewer">Open in Viewer</a>
<a href="#" class="report-icon report-icon--open lh-export--gist" data-action="save-gist">Save as Gist</a>
</div>
<div class="lh-export">
<button class="report-icon report-icon--share lh-export__button" title="Export report"></button>
<div class="lh-export__dropdown">
<a href="#" class="report-icon report-icon--print" data-action="print-summary">Print Summary</a>
<a href="#" class="report-icon report-icon--print" data-action="print-expanded">Print Expanded</a>
<a href="#" class="report-icon report-icon--copy" data-action="copy">Copy JSON</a>
<a href="#" class="report-icon report-icon--download" data-action="save-html">Save as HTML</a>
<a href="#" class="report-icon report-icon--download" data-action="save-json">Save as JSON</a>
<a href="#" class="report-icon report-icon--open lh-export--viewer" data-action="open-viewer">Open in Viewer</a>
<a href="#" class="report-icon report-icon--open lh-export--gist" data-action="save-gist">Save as Gist</a>
</div>
</div>
</div>
</template>

<!-- Lighthouse footer -->
Expand Down