Skip to content

Commit

Permalink
Fix size of cards inside stack cards (#21190)
Browse files Browse the repository at this point in the history
* Fix size of cards inside stack cards

* Apply style everywhere

* Fix stack

* Fix grid stack

* Set block only for square
  • Loading branch information
piitaya authored Jun 27, 2024
1 parent fd64d17 commit da2865d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/panels/lovelace/cards/hui-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export class HuiCard extends ReactiveElement {
private _listeners: MediaQueriesListener[] = [];

protected createRenderRoot() {
const style = document.createElement("style");
style.textContent = `hui-card { display: contents }`;
this.append(style);
return this;
}

Expand Down
1 change: 1 addition & 0 deletions src/panels/lovelace/cards/hui-grid-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class HuiGridCard extends HuiStackCard<GridCardConfig> {
}
:host([square]) #root > *:not([hidden]) {
display: block;
grid-row: 1 / 1;
grid-column: 1 / 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/panels/lovelace/cards/hui-horizontal-stack-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class HuiHorizontalStackCard extends HuiStackCard {
height: 100%;
gap: var(--horizontal-stack-card-gap, var(--stack-card-gap, 8px));
}
#root > * {
#root > hui-card > * {
flex: 1 1 0;
min-width: 0;
}
Expand Down

0 comments on commit da2865d

Please sign in to comment.