mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +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;
|
title?: string;
|
||||||
visibility?: Condition[];
|
visibility?: Condition[];
|
||||||
column_span?: number;
|
column_span?: number;
|
||||||
|
row_span?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LovelaceSectionConfig extends LovelaceBaseSectionConfig {
|
export interface LovelaceSectionConfig extends LovelaceBaseSectionConfig {
|
||||||
|
@ -166,6 +166,8 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
|
|||||||
maxColumnCount
|
maxColumnCount
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const rowSpan = sectionConfig?.row_span || 1;
|
||||||
|
|
||||||
(section as any).itemPath = [idx];
|
(section as any).itemPath = [idx];
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
@ -173,6 +175,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
|
|||||||
class="section"
|
class="section"
|
||||||
style=${styleMap({
|
style=${styleMap({
|
||||||
"--column-span": columnSpan,
|
"--column-span": columnSpan,
|
||||||
|
"--row-span": rowSpan,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
${
|
${
|
||||||
@ -332,6 +335,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
|
|||||||
.section {
|
.section {
|
||||||
border-radius: var(--ha-card-border-radius, 12px);
|
border-radius: var(--ha-card-border-radius, 12px);
|
||||||
grid-column: span var(--column-span);
|
grid-column: span var(--column-span);
|
||||||
|
grid-row: span var(--row-span);
|
||||||
}
|
}
|
||||||
|
|
||||||
.section:has(hui-section[hidden]) {
|
.section:has(hui-section[hidden]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user