From 718904a85371a93a802ae6410ebf19e066cbedb4 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 3 Mar 2021 14:31:39 +0100 Subject: [PATCH] Add max height to yaml editor (#8527) --- src/panels/lovelace/editor/hui-element-editor.ts | 3 +++ src/resources/codemirror.ts | 1 + 2 files changed, 4 insertions(+) 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" },