Skip to content

Commit 8967ed8

Browse files
authored
Added hide_card_background card level option
1 parent 89f91ec commit 8967ed8

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

compact-power-card.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ class CompactPowerCard extends (window.LitElement ||
6464
name: "remove_glow_effects",
6565
selector: { boolean: {} },
6666
},
67+
{
68+
name: "hide_card_background",
69+
selector: { boolean: {} },
70+
},
6771
]
6872
},
6973
{
@@ -567,6 +571,12 @@ class CompactPowerCard extends (window.LitElement ||
567571
height: 100%;
568572
}
569573
574+
ha-card.transparent {
575+
background: transparent;
576+
box-shadow: none;
577+
border: none;
578+
}
579+
570580
.canvas {
571581
opacity: 0;
572582
transition: opacity 0.2s ease;
@@ -3894,6 +3904,7 @@ class CompactPowerCard extends (window.LitElement ||
38943904
: `M${gridNode.x} ${gridNode.y} H${batteryNode.x}`;
38953905

38963906
const layoutReady = this._layoutReady;
3907+
const hideCardBackground = this._coerceBoolean(this._config?.hide_card_background, false);
38973908

38983909
return html`
38993910
<ha-card class="${[
@@ -3904,6 +3915,7 @@ class CompactPowerCard extends (window.LitElement ||
39043915
hasGridLabels ? "has-grid-labels" : "",
39053916
hasBatteryLabels ? "has-battery-labels" : "",
39063917
hasSingleSideLabel ? "has-single-side-label" : "",
3918+
hideCardBackground ? "transparent" : "",
39073919
layoutReady ? "layout-ready" : "",
39083920
]
39093921
.filter(Boolean)

0 commit comments

Comments
 (0)