mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Add advanced yaml only row_span option for sections (#21833)
This commit is contained in:
parent
ab534933fc
commit
2c975d4f41
@ -6,6 +6,7 @@ export interface LovelaceBaseSectionConfig {
|
||||
title?: string;
|
||||
visibility?: Condition[];
|
||||
column_span?: number;
|
||||
row_span?: number;
|
||||
}
|
||||
|
||||
export interface LovelaceSectionConfig extends LovelaceBaseSectionConfig {
|
||||
|
@ -166,6 +166,8 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
|
||||
maxColumnCount
|
||||
);
|
||||
|
||||
const rowSpan = sectionConfig?.row_span || 1;
|
||||
|
||||
(section as any).itemPath = [idx];
|
||||
|
||||
return html`
|
||||
@ -173,6 +175,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
|
||||
class="section"
|
||||
style=${styleMap({
|
||||
"--column-span": columnSpan,
|
||||
"--row-span": rowSpan,
|
||||
})}
|
||||
>
|
||||
${
|
||||
@ -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]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user