Skip to content

Commit

Permalink
Fill background in under right border-radius
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Nov 22, 2023
1 parent 376358c commit 4de5eed
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions frontend/src/components/meter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,18 @@ export class DividedMeterBar extends LitElement {
`;

render() {
const remainder = this.quota - this.value;
return html`<sl-tooltip>
<div slot="content"><slot></slot></div>
${when(this.value, () => {
return html`<div
class="bar ${this.value < this.quota
? css`rightBorderRadius`
: css``}"
style="width:${this.value}%"
></div>`;
})}
${when(remainder, () => {
return html`<div class="quotaBar" style="width:${remainder}%"></div>`;
})}
<div class="quotaBar" style="width:100%">
${when(this.value, () => {
return html`<div
class="bar ${this.value < this.quota
? css`rightBorderRadius`
: css``}"
style="width:${this.value}%"
></div>`;
})}
</div>
</sl-tooltip>`;
}
}
Expand Down

0 comments on commit 4de5eed

Please sign in to comment.