diff --git a/src/panels/developer-tools/template/developer-tools-template.ts b/src/panels/developer-tools/template/developer-tools-template.ts index f16f77bd1f..9486e5e84a 100644 --- a/src/panels/developer-tools/template/developer-tools-template.ts +++ b/src/panels/developer-tools/template/developer-tools-template.ts @@ -181,17 +181,21 @@ class HaPanelDevTemplate extends LitElement { >` : nothing} ${this._templateResult - ? html`${this.hass.localize( - "ui.panel.developer-tools.tabs.templates.result_type" - )}: - ${resultType} - -
${type === "object" - ? JSON.stringify(this._templateResult.result, null, 2) - : this._templateResult.result}+ ? html`
+${type === "object" + ? JSON.stringify(this._templateResult.result, null, 2) + : this._templateResult.result}+
+ ${this.hass.localize( + "ui.panel.developer-tools.tabs.templates.result_type" + )}: + ${resultType} +
${this._templateResult.listeners.time ? html`@@ -281,6 +285,16 @@ class HaPanelDevTemplate extends LitElement { max(16px, env(safe-area-inset-left)); } + .content.horizontal { + --code-mirror-max-height: calc( + 100vh - var(--header-height) - + (var(--paper-font-body1_-_line-height) * 3) - (1em * 2) - + (max(16px, env(safe-area-inset-top)) * 2) - + (max(16px, env(safe-area-inset-bottom)) * 2) - + (var(--ha-card-border-width, 1px) * 2) - 179px + ); + } + ha-card { margin-bottom: 16px; } @@ -293,8 +307,9 @@ class HaPanelDevTemplate extends LitElement { color: var(--primary-color); } - .horizontal .edit-pane { - max-width: 50%; + .content.horizontal > * { + width: 50%; + margin-bottom: 0px; } .render-spinner { @@ -316,15 +331,35 @@ class HaPanelDevTemplate extends LitElement { white-space: pre-wrap; background-color: var(--secondary-background-color); padding: 8px; + margin-top: 0; + margin-bottom: 0; direction: ltr; } + p, + ul { + margin-block-end: 0; + } + + .content.horizontal .render-pane .card-content { + overflow: auto; + max-height: calc( + var(--code-mirror-max-height) + + 47px - var(--ha-card-border-radius, 12px) + ); + } + + .content.horizontal .render-pane { + overflow: hidden; + padding-bottom: var(--ha-card-border-radius, 12px); + } + .all_listeners { color: var(--warning-color); } @media all and (max-width: 870px) { - .render-pane { + .content ha-card { max-width: 100%; } }