diff --git a/src/panels/lovelace/editor/hui-element-editor.ts b/src/panels/lovelace/editor/hui-element-editor.ts index 01fe25ec57..2906c73f13 100644 --- a/src/panels/lovelace/editor/hui-element-editor.ts +++ b/src/panels/lovelace/editor/hui-element-editor.ts @@ -359,6 +359,9 @@ export abstract class HuiElementEditor extends LitElement { .yaml-editor { padding: 8px 0px; } + ha-code-editor { + --code-mirror-max-height: calc(100vh - 245px); + } .error, .warning, .info { diff --git a/src/resources/codemirror.ts b/src/resources/codemirror.ts index f647b3e354..aedfd3f34a 100644 --- a/src/resources/codemirror.ts +++ b/src/resources/codemirror.ts @@ -33,6 +33,7 @@ export const theme = CMEditorView.theme({ "var(--code-editor-background-color, var(--card-background-color))", "& ::selection": { backgroundColor: "rgba(var(--rgb-primary-color), 0.3)" }, height: "var(--code-mirror-height, auto)", + maxHeight: "var(--code-mirror-max-height, unset)", }, $scroller: { outline: "none" },