Skip to content

Commit

Permalink
misc(treemap): fix node coverage shading (#12603)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored Jun 2, 2021
1 parent d0d2ca0 commit dbe7884
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lighthouse-treemap/app/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,8 @@ class TreemapViewer {

// Shade the element to communicate coverage.
if (this.currentViewMode.id === 'unused-bytes') {
const pctUsed = (1 - (node.unusedBytes || 0) / node.resourceBytes) * 100;
node.dom.style.setProperty('--pctUsed', `${pctUsed}%`);
const pctUnused = (node.unusedBytes || 0) / node.resourceBytes * 100;
node.dom.style.setProperty('--pctUnused', `${pctUnused}%`);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-treemap/app/styles/treemap.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ header {
right: 0;
content: '';
display: block;
width: var(--pctUsed);
width: var(--pctUnused);
background: repeating-linear-gradient(
-45deg,
hsla(0, 0%, 0%, 0),
Expand Down

0 comments on commit dbe7884

Please sign in to comment.