+ ${repeat(
+ sections,
+ (section) => this._getSectionKey(section),
+ (section, idx) => {
+ const columnSpan = Math.min(
+ section.config.column_span || 1,
+ maxColumnCount
+ );
+ const rowSpan = section.config.row_span || 1;
- return html`
+ return html`
`;
- }
- )}
- ${editMode
- ? html`
-
-
-
-
+ }
+ )}
+ ${editMode
+ ? html`
+
+
+
+
+ ${this.hass.localize(
+ "ui.panel.lovelace.editor.section.drop_card_create_section"
+ )}
+
+
+
+
+
+ `
+ : nothing}
+ ${editMode && this._config?.cards?.length
+ ? html`
+
+
-
+ .viewIndex=${this.index}
+ preview
+ import-only
+ >
-
- `
- : nothing}
- ${editMode && this._config?.cards?.length
- ? html`
-
-
-
-
- `
- : nothing}
-
-
+ `
+ : nothing}
+
+
+
`;
}
@@ -429,6 +435,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
--column-gap: var(--ha-view-sections-column-gap, 32px);
--column-max-width: var(--ha-view-sections-column-max-width, 500px);
--column-min-width: var(--ha-view-sections-column-min-width, 320px);
+ --top-margin: var(--ha-view-sections-extra-top-margin, 80px);
display: block;
}
@@ -438,6 +445,11 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
}
}
+ .wrapper.top-margin {
+ display: block;
+ margin-top: var(--top-margin);
+ }
+
.container > * {
position: relative;
width: 100%;
diff --git a/src/translations/en.json b/src/translations/en.json
index 45e3653060..4bcb79ba06 100644
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -6569,6 +6569,8 @@
"section_specifics": "Sections view specific settings",
"dense_section_placement": "Dense section placement",
"dense_section_placement_helper": "Will try to fill gaps with sections that fit the gap. This may make section placement less predictable.",
+ "top_margin": "Add additional space above",
+ "top_margin_helper": "Helps reveal more of the background",
"subview_helper": "Subviews don't appear in tabs and have a back button.",
"edit_ui": "Edit in visual editor",
"edit_yaml": "Edit in YAML",