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(redesign): three dots for export button #8629

Merged
merged 9 commits into from
May 7, 2019
3 changes: 1 addition & 2 deletions lighthouse-core/report/html/renderer/report-ui-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ class ReportUIFeatures {
*/
onExportButtonClick(e) {
e.preventDefault();
const el = /** @type {Element} */ (e.target);
el.classList.toggle('active');
this.exportButton.classList.toggle('active');
this._document.addEventListener('keydown', this.onKeyDown);
}

Expand Down
5 changes: 2 additions & 3 deletions lighthouse-core/report/html/report-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
--lh-score-highlight-bg: hsla(0, 0%, 90%, 0.2);
--lh-score-icon-background-size: 24px;
--lh-group-icon-background-size: var(--lh-score-icon-background-size);
--lh-export-icon-size: var(--lh-score-icon-background-size);
--lh-export-icon-color: var(--medium-75-gray);
--lh-score-margin: 12px;
--lh-table-header-bg: #f8f9fa;
--lh-table-higlight-bg: hsla(0, 0%, 75%, 0.1);
Expand Down Expand Up @@ -369,9 +371,6 @@
pointer-events: none;
}

.report-icon--share {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"/></svg>');
}
.report-icon--print {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/><path fill="none" d="M0 0h24v24H0z"/></svg>');
}
Expand Down
31 changes: 19 additions & 12 deletions lighthouse-core/report/html/templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@
justify-content: center;
background-color: var(--color-sticky-header-bg);
border-bottom: 1px solid var(--color-black-200);
z-index: 1000;
padding-top: var(--score-container-padding);
padding-bottom: 4px;
z-index: 1;
pointer-events: none;
opacity: 0;
}
Expand Down Expand Up @@ -249,20 +251,20 @@
will-change: transform;
}
.lh-export__button {
border: 1px solid #dadada;
border-radius: 2px;
width: var(--lh-export-icon-size);
height: var(--lh-export-icon-size);
cursor: pointer;
outline: none;
height: 23px;
width: 30px;
background-repeat: no-repeat;
background-size: 18px;
background-position: 50% 50%;
will-change: transform;
margin-right: 5px;
}
.lh-export__button svg {
fill: var(--lh-export-icon-color);
}
.dark .lh-export__button svg {
filter: invert(1);
}
.lh-export__button:focus,
.lh-export__button.active {
box-shadow: 1px 1px 3px #ccc;
outline: none;
}
.lh-export__button.active + .lh-export__dropdown {
opacity: 1;
Expand Down Expand Up @@ -348,7 +350,12 @@
<a href="" class="lh-topbar__url" target="_blank" rel="noopener"></a>

<div class="lh-export">
<button class="report-icon report-icon--share lh-export__button" title="Export report"></button>
<div class="report-icon report-icon--share lh-export__button" title="Export report">
<svg width="100%" height="100%" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
</svg>
</div>
<div class="lh-export__dropdown">
<!-- TODO(i18n): localize export dropdown -->
<a href="#" class="report-icon report-icon--print" data-action="print-summary">Print Summary</a>
Expand Down