diff --git a/src/components/ha-dialog.ts b/src/components/ha-dialog.ts index 600ea6c20b..ff770e7bb7 100644 --- a/src/components/ha-dialog.ts +++ b/src/components/ha-dialog.ts @@ -16,6 +16,9 @@ export class HaDialog extends MwcDialog { .mdc-dialog__actions { justify-content: var(--justify-action-buttons, flex-end); } + .mdc-dialog__container { + align-items: var(--vertial-align-dialog, center); + } `, ]; } diff --git a/src/panels/config/person/dialog-person-detail.ts b/src/panels/config/person/dialog-person-detail.ts index b6e1f3fac7..10e995cf8f 100644 --- a/src/panels/config/person/dialog-person-detail.ts +++ b/src/panels/config/person/dialog-person-detail.ts @@ -55,13 +55,26 @@ class DialogPersonDetail extends LitElement { return html``; } const nameInvalid = this._name.trim() === ""; + const title = html` + ${this._params.entry + ? this._params.entry.name + : this.hass!.localize("ui.panel.config.person.detail.new_person")} + + `; return html`
${this._error @@ -225,11 +238,20 @@ class DialogPersonDetail extends LitElement { return [ css` ha-dialog { - min-width: 400px; - max-width: 600px; + --mdc-dialog-min-width: 400px; + --mdc-dialog-max-width: 600px; --mdc-dialog-title-ink-color: var(--primary-text-color); --justify-action-buttons: space-between; } + /* make dialog fullscreen on small screens */ + @media all and (max-width: 450px), all and (max-height: 500px) { + ha-dialog { + --mdc-dialog-min-width: 100vw; + --mdc-dialog-max-height: 100vh; + --mdc-dialog-shape-radius: 0px; + --vertial-align-dialog: flex-end; + } + } .form { padding-bottom: 24px; } diff --git a/src/panels/config/zone/dialog-zone-detail.ts b/src/panels/config/zone/dialog-zone-detail.ts index 1e58e52e4d..a4afc11ec2 100644 --- a/src/panels/config/zone/dialog-zone-detail.ts +++ b/src/panels/config/zone/dialog-zone-detail.ts @@ -62,13 +62,26 @@ class DialogZoneDetail extends LitElement { if (!this._params) { return html``; } + const title = html` + ${this._params.entry + ? this._params.entry.name + : this.hass!.localize("ui.panel.config.zone.detail.new_zone")} + + `; return html`
${this._error @@ -252,6 +265,16 @@ class DialogZoneDetail extends LitElement { --mdc-dialog-min-width: 600px; } } + + /* make dialog fullscreen on small screens */ + @media all and (max-width: 450px), all and (max-height: 500px) { + ha-dialog { + --mdc-dialog-min-width: 100vw; + --mdc-dialog-max-height: 100vh; + --mdc-dialog-shape-radius: 0px; + --vertial-align-dialog: flex-end; + } + } .form { padding-bottom: 24px; }