Skip to content

Commit

Permalink
Add advanced yaml only row_span option for sections (#21833)
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya authored Sep 3, 2024
1 parent ab53493 commit 2c975d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/data/lovelace/config/section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface LovelaceBaseSectionConfig {
title?: string;
visibility?: Condition[];
column_span?: number;
row_span?: number;
}

export interface LovelaceSectionConfig extends LovelaceBaseSectionConfig {
Expand Down
4 changes: 4 additions & 0 deletions src/panels/lovelace/views/hui-sections-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,16 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
maxColumnCount
);
const rowSpan = sectionConfig?.row_span || 1;
(section as any).itemPath = [idx];
return html`
<div
class="section"
style=${styleMap({
"--column-span": columnSpan,
"--row-span": rowSpan,
})}
>
${
Expand Down Expand Up @@ -332,6 +335,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
.section {
border-radius: var(--ha-card-border-radius, 12px);
grid-column: span var(--column-span);
grid-row: span var(--row-span);
}
.section:has(hui-section[hidden]) {
Expand Down

0 comments on commit 2c975d4

Please sign in to comment.