mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Compact header (#7369)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
fb9bd0eb7d
commit
3c4b0d4a74
@ -736,8 +736,7 @@ class HaSidebar extends LitElement {
|
|||||||
border-left: 1px solid var(--divider-color);
|
border-left: 1px solid var(--divider-color);
|
||||||
}
|
}
|
||||||
.menu {
|
.menu {
|
||||||
box-sizing: border-box;
|
height: var(--header-height);
|
||||||
height: 65px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 8.5px;
|
padding: 0 8.5px;
|
||||||
border-bottom: 1px solid transparent;
|
border-bottom: 1px solid transparent;
|
||||||
@ -794,7 +793,10 @@ class HaSidebar extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: calc(100% - 196px - env(safe-area-inset-bottom));
|
height: calc(100% - var(--header-height) - 132px);
|
||||||
|
height: calc(
|
||||||
|
100% - var(--header-height) - 132px - env(safe-area-inset-bottom)
|
||||||
|
);
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
background: none;
|
background: none;
|
||||||
margin-left: env(safe-area-inset-left);
|
margin-left: env(safe-area-inset-left);
|
||||||
|
@ -34,14 +34,17 @@ export class HaTabs extends PaperTabs {
|
|||||||
|
|
||||||
superStyle!.appendChild(
|
superStyle!.appendChild(
|
||||||
document.createTextNode(`
|
document.createTextNode(`
|
||||||
|
:host {
|
||||||
|
padding-top: .5px;
|
||||||
|
}
|
||||||
.not-visible {
|
.not-visible {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
:host > paper-icon-button:first-of-type {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
paper-icon-button {
|
paper-icon-button {
|
||||||
margin: 0 -8px 0 0;
|
width: 24px;
|
||||||
|
height: 48px;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
);
|
);
|
||||||
@ -85,7 +88,7 @@ export class HaTabs extends PaperTabs {
|
|||||||
|
|
||||||
if (this._lastLeftHiddenState !== this._leftHidden) {
|
if (this._lastLeftHiddenState !== this._leftHidden) {
|
||||||
this._lastLeftHiddenState = this._leftHidden;
|
this._lastLeftHiddenState = this._leftHidden;
|
||||||
this.$.tabsContainer.scrollLeft += this._leftHidden ? -46 : 46;
|
this.$.tabsContainer.scrollLeft += this._leftHidden ? -23 : 23;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ export class HuiNotificationDrawer extends EventsMixin(
|
|||||||
padding-left: env(safe-area-inset-left);
|
padding-left: env(safe-area-inset-left);
|
||||||
padding-right: env(safe-area-inset-right);
|
padding-right: env(safe-area-inset-right);
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
height: calc(100% - 65px);
|
height: calc(100% - 1px - var(--header-height));
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: var(--primary-background-color);
|
background-color: var(--primary-background-color);
|
||||||
color: var(--primary-text-color);
|
color: var(--primary-text-color);
|
||||||
|
@ -64,7 +64,7 @@ class HassErrorScreen extends LitElement {
|
|||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
color: var(--primary-text-color);
|
color: var(--primary-text-color);
|
||||||
height: calc(100% - 64px);
|
height: calc(100% - var(--header-height));
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
@ -80,7 +80,7 @@ class HassLoadingScreen extends LitElement {
|
|||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
height: calc(100% - 64px);
|
height: calc(100% - var(--header-height));
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
@ -97,7 +97,7 @@ class HassSubpage extends LitElement {
|
|||||||
.content {
|
.content {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - 65px);
|
height: calc(100% - 1px - var(--header-height));
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
|
@ -227,7 +227,7 @@ export class HaTabsSubpageDataTable extends LitElement {
|
|||||||
--data-table-border-width: 0;
|
--data-table-border-width: 0;
|
||||||
}
|
}
|
||||||
:host(:not([narrow])) ha-data-table {
|
:host(:not([narrow])) ha-data-table {
|
||||||
height: calc(100vh - 65px);
|
height: calc(100vh - 1px - var(--header-height));
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.table-header {
|
.table-header {
|
||||||
|
@ -278,9 +278,10 @@ class HassTabsSubpage extends LitElement {
|
|||||||
);
|
);
|
||||||
margin-left: env(safe-area-inset-left);
|
margin-left: env(safe-area-inset-left);
|
||||||
margin-right: env(safe-area-inset-right);
|
margin-right: env(safe-area-inset-right);
|
||||||
height: calc(100% - 65px);
|
height: calc(100% - 1px - var(--header-height));
|
||||||
height: calc(100% - 65px - env(safe-area-inset-bottom));
|
height: calc(
|
||||||
overflow-y: auto;
|
100% - 1px - var(--header-height) - env(safe-area-inset-bottom)
|
||||||
|
);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ class PanelCalendar extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:host(:not([narrow])) .content {
|
:host(:not([narrow])) .content {
|
||||||
height: calc(100vh - 64px);
|
height: calc(100vh - var(--header-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-list {
|
.calendar-list {
|
||||||
|
@ -834,7 +834,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
|
|||||||
--data-table-border-width: 0;
|
--data-table-border-width: 0;
|
||||||
}
|
}
|
||||||
:host(:not([narrow])) ha-data-table {
|
:host(:not([narrow])) ha-data-table {
|
||||||
height: calc(100vh - 65px);
|
height: calc(100vh - 1px - var(--header-height));
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
ha-button-menu {
|
ha-button-menu {
|
||||||
|
@ -13,7 +13,7 @@ class HaPanelIframe extends PolymerElement {
|
|||||||
border: 0;
|
border: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: calc(100% - 64px);
|
height: calc(100% - var(--header-height));
|
||||||
background-color: var(--primary-background-color);
|
background-color: var(--primary-background-color);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -57,7 +57,7 @@ export class HuiStartingCard extends LitElement implements LovelaceCard {
|
|||||||
return css`
|
return css`
|
||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
height: calc(100vh - 64px);
|
height: calc(100vh - var(--header-height));
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
ha-circular-progress {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
|
@ -3,11 +3,15 @@ import "@material/mwc-list/mwc-list-item";
|
|||||||
import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item";
|
import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item";
|
||||||
import {
|
import {
|
||||||
mdiClose,
|
mdiClose,
|
||||||
|
mdiCog,
|
||||||
mdiDotsVertical,
|
mdiDotsVertical,
|
||||||
|
mdiHelp,
|
||||||
mdiHelpCircle,
|
mdiHelpCircle,
|
||||||
mdiMicrophone,
|
mdiMicrophone,
|
||||||
mdiPencil,
|
mdiPencil,
|
||||||
mdiPlus,
|
mdiPlus,
|
||||||
|
mdiRefresh,
|
||||||
|
mdiShape,
|
||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
import "@polymer/app-layout/app-header/app-header";
|
import "@polymer/app-layout/app-header/app-header";
|
||||||
import "@polymer/app-layout/app-scroll-effects/effects/waterfall";
|
import "@polymer/app-layout/app-scroll-effects/effects/waterfall";
|
||||||
@ -21,6 +25,7 @@ import {
|
|||||||
LitElement,
|
LitElement,
|
||||||
property,
|
property,
|
||||||
PropertyValues,
|
PropertyValues,
|
||||||
|
query,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { classMap } from "lit-html/directives/class-map";
|
import { classMap } from "lit-html/directives/class-map";
|
||||||
@ -51,6 +56,7 @@ import {
|
|||||||
} from "../../dialogs/generic/show-dialog-box";
|
} from "../../dialogs/generic/show-dialog-box";
|
||||||
import { showVoiceCommandDialog } from "../../dialogs/voice-command-dialog/show-ha-voice-command-dialog";
|
import { showVoiceCommandDialog } from "../../dialogs/voice-command-dialog/show-ha-voice-command-dialog";
|
||||||
import "../../layouts/ha-app-layout";
|
import "../../layouts/ha-app-layout";
|
||||||
|
import type { haAppLayout } from "../../layouts/ha-app-layout";
|
||||||
import { haStyle } from "../../resources/styles";
|
import { haStyle } from "../../resources/styles";
|
||||||
import type { HomeAssistant } from "../../types";
|
import type { HomeAssistant } from "../../types";
|
||||||
import { documentationUrl } from "../../util/documentation-url";
|
import { documentationUrl } from "../../util/documentation-url";
|
||||||
@ -72,6 +78,8 @@ class HUIRoot extends LitElement {
|
|||||||
|
|
||||||
@internalProperty() private _curView?: number | "hass-unused-entities";
|
@internalProperty() private _curView?: number | "hass-unused-entities";
|
||||||
|
|
||||||
|
@query("ha-app-layout", true) private _appLayout!: haAppLayout;
|
||||||
|
|
||||||
private _viewCache?: { [viewId: string]: HUIView };
|
private _viewCache?: { [viewId: string]: HUIView };
|
||||||
|
|
||||||
private _debouncedConfigChanged: () => void;
|
private _debouncedConfigChanged: () => void;
|
||||||
@ -187,11 +195,50 @@ class HUIRoot extends LitElement {
|
|||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.narrow=${this.narrow}
|
.narrow=${this.narrow}
|
||||||
></ha-menu-button>
|
></ha-menu-button>
|
||||||
<div main-title>${this.config.title || "Home Assistant"}</div>
|
${this.lovelace!.config.views.length > 1
|
||||||
${this._conversation(this.hass.config.components)
|
? html`
|
||||||
|
<ha-tabs
|
||||||
|
scrollable
|
||||||
|
.selected="${this._curView}"
|
||||||
|
@iron-activate="${this._handleViewSelected}"
|
||||||
|
dir="${computeRTLDirection(this.hass!)}"
|
||||||
|
>
|
||||||
|
${this.lovelace!.config.views.map(
|
||||||
|
(view) => html`
|
||||||
|
<paper-tab
|
||||||
|
aria-label="${view.title}"
|
||||||
|
class="${classMap({
|
||||||
|
"hide-tab": Boolean(
|
||||||
|
view.visible !== undefined &&
|
||||||
|
((Array.isArray(view.visible) &&
|
||||||
|
!view.visible.some(
|
||||||
|
(e) => e.user === this.hass!.user!.id
|
||||||
|
)) ||
|
||||||
|
view.visible === false)
|
||||||
|
),
|
||||||
|
})}"
|
||||||
|
>
|
||||||
|
${view.icon
|
||||||
|
? html`
|
||||||
|
<ha-icon
|
||||||
|
title="${view.title}"
|
||||||
|
.icon="${view.icon}"
|
||||||
|
></ha-icon>
|
||||||
|
`
|
||||||
|
: view.title || "Unnamed view"}
|
||||||
|
</paper-tab>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
</ha-tabs>
|
||||||
|
`
|
||||||
|
: html`<div main-title>${this.config.title}</div>`}
|
||||||
|
${!this.narrow &&
|
||||||
|
this._conversation(this.hass.config.components)
|
||||||
? html`
|
? html`
|
||||||
<mwc-icon-button
|
<mwc-icon-button
|
||||||
label="Start conversation"
|
.label=${this.hass!.localize(
|
||||||
|
"ui.panel.lovelace.menu.start_conversation"
|
||||||
|
)}
|
||||||
@click=${this._showVoiceCommandDialog}
|
@click=${this._showVoiceCommandDialog}
|
||||||
>
|
>
|
||||||
<ha-svg-icon .path=${mdiMicrophone}></ha-svg-icon>
|
<ha-svg-icon .path=${mdiMicrophone}></ha-svg-icon>
|
||||||
@ -210,27 +257,63 @@ class HUIRoot extends LitElement {
|
|||||||
>
|
>
|
||||||
<ha-svg-icon .path=${mdiDotsVertical}></ha-svg-icon>
|
<ha-svg-icon .path=${mdiDotsVertical}></ha-svg-icon>
|
||||||
</mwc-icon-button>
|
</mwc-icon-button>
|
||||||
|
${this.narrow &&
|
||||||
|
this._conversation(this.hass.config.components)
|
||||||
|
? html`
|
||||||
|
<mwc-list-item
|
||||||
|
.label=${this.hass!.localize(
|
||||||
|
"ui.panel.lovelace.menu.start_conversation"
|
||||||
|
)}
|
||||||
|
graphic="icon"
|
||||||
|
@request-selected=${this._showVoiceCommandDialog}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
>${this.hass!.localize(
|
||||||
|
"ui.panel.lovelace.menu.start_conversation"
|
||||||
|
)}</span
|
||||||
|
>
|
||||||
|
<ha-svg-icon
|
||||||
|
slot="graphic"
|
||||||
|
.path=${mdiMicrophone}
|
||||||
|
></ha-svg-icon>
|
||||||
|
</mwc-list-item>
|
||||||
|
`
|
||||||
|
: ""}
|
||||||
${this._yamlMode
|
${this._yamlMode
|
||||||
? html`
|
? html`
|
||||||
<mwc-list-item
|
<mwc-list-item
|
||||||
aria-label=${this.hass!.localize(
|
aria-label=${this.hass!.localize(
|
||||||
"ui.panel.lovelace.menu.refresh"
|
"ui.panel.lovelace.menu.refresh"
|
||||||
)}
|
)}
|
||||||
|
graphic="icon"
|
||||||
@request-selected="${this._handleRefresh}"
|
@request-selected="${this._handleRefresh}"
|
||||||
>
|
>
|
||||||
${this.hass!.localize(
|
<span
|
||||||
"ui.panel.lovelace.menu.refresh"
|
>${this.hass!.localize(
|
||||||
)}
|
"ui.panel.lovelace.menu.refresh"
|
||||||
|
)}</span
|
||||||
|
>
|
||||||
|
<ha-svg-icon
|
||||||
|
slot="graphic"
|
||||||
|
.path=${mdiRefresh}
|
||||||
|
></ha-svg-icon>
|
||||||
</mwc-list-item>
|
</mwc-list-item>
|
||||||
<mwc-list-item
|
<mwc-list-item
|
||||||
aria-label=${this.hass!.localize(
|
aria-label=${this.hass!.localize(
|
||||||
"ui.panel.lovelace.unused_entities.title"
|
"ui.panel.lovelace.unused_entities.title"
|
||||||
)}
|
)}
|
||||||
|
graphic="icon"
|
||||||
@request-selected="${this._handleUnusedEntities}"
|
@request-selected="${this._handleUnusedEntities}"
|
||||||
>
|
>
|
||||||
${this.hass!.localize(
|
<span
|
||||||
"ui.panel.lovelace.unused_entities.title"
|
>${this.hass!.localize(
|
||||||
)}
|
"ui.panel.lovelace.unused_entities.title"
|
||||||
|
)}</span
|
||||||
|
>
|
||||||
|
<ha-svg-icon
|
||||||
|
slot="graphic"
|
||||||
|
.path=${mdiShape}
|
||||||
|
></ha-svg-icon>
|
||||||
</mwc-list-item>
|
</mwc-list-item>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
@ -238,6 +321,7 @@ class HUIRoot extends LitElement {
|
|||||||
?.mode === "yaml"
|
?.mode === "yaml"
|
||||||
? html`
|
? html`
|
||||||
<mwc-list-item
|
<mwc-list-item
|
||||||
|
graphic="icon"
|
||||||
aria-label=${this.hass!.localize(
|
aria-label=${this.hass!.localize(
|
||||||
"ui.panel.lovelace.menu.reload_resources"
|
"ui.panel.lovelace.menu.reload_resources"
|
||||||
)}
|
)}
|
||||||
@ -246,12 +330,17 @@ class HUIRoot extends LitElement {
|
|||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
"ui.panel.lovelace.menu.reload_resources"
|
"ui.panel.lovelace.menu.reload_resources"
|
||||||
)}
|
)}
|
||||||
|
<ha-svg-icon
|
||||||
|
slot="graphic"
|
||||||
|
.path=${mdiRefresh}
|
||||||
|
></ha-svg-icon>
|
||||||
</mwc-list-item>
|
</mwc-list-item>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${this.hass!.user?.is_admin && !this.hass!.config.safe_mode
|
${this.hass!.user?.is_admin && !this.hass!.config.safe_mode
|
||||||
? html`
|
? html`
|
||||||
<mwc-list-item
|
<mwc-list-item
|
||||||
|
graphic="icon"
|
||||||
aria-label=${this.hass!.localize(
|
aria-label=${this.hass!.localize(
|
||||||
"ui.panel.lovelace.menu.configure_ui"
|
"ui.panel.lovelace.menu.configure_ui"
|
||||||
)}
|
)}
|
||||||
@ -260,6 +349,10 @@ class HUIRoot extends LitElement {
|
|||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
"ui.panel.lovelace.menu.configure_ui"
|
"ui.panel.lovelace.menu.configure_ui"
|
||||||
)}
|
)}
|
||||||
|
<ha-svg-icon
|
||||||
|
slot="graphic"
|
||||||
|
.path=${mdiCog}
|
||||||
|
></ha-svg-icon>
|
||||||
</mwc-list-item>
|
</mwc-list-item>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
@ -270,17 +363,22 @@ class HUIRoot extends LitElement {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<mwc-list-item
|
<mwc-list-item
|
||||||
|
graphic="icon"
|
||||||
aria-label=${this.hass!.localize(
|
aria-label=${this.hass!.localize(
|
||||||
"ui.panel.lovelace.menu.help"
|
"ui.panel.lovelace.menu.help"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
${this.hass!.localize("ui.panel.lovelace.menu.help")}
|
${this.hass!.localize("ui.panel.lovelace.menu.help")}
|
||||||
|
<ha-svg-icon
|
||||||
|
slot="graphic"
|
||||||
|
.path=${mdiHelp}
|
||||||
|
></ha-svg-icon>
|
||||||
</mwc-list-item>
|
</mwc-list-item>
|
||||||
</a>
|
</a>
|
||||||
</ha-button-menu>
|
</ha-button-menu>
|
||||||
</app-toolbar>
|
</app-toolbar>
|
||||||
`}
|
`}
|
||||||
${this.lovelace!.config.views.length > 1 || this._editMode
|
${this._editMode
|
||||||
? html`
|
? html`
|
||||||
<div sticky>
|
<div sticky>
|
||||||
<ha-tabs
|
<ha-tabs
|
||||||
@ -368,14 +466,7 @@ class HUIRoot extends LitElement {
|
|||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
</app-header>
|
</app-header>
|
||||||
<div
|
<div id="view" @ll-rebuild="${this._debouncedConfigChanged}"></div>
|
||||||
id="view"
|
|
||||||
class="${classMap({
|
|
||||||
"tabs-hidden":
|
|
||||||
!this._editMode && this.lovelace!.config.views.length < 2,
|
|
||||||
})}"
|
|
||||||
@ll-rebuild="${this._debouncedConfigChanged}"
|
|
||||||
></div>
|
|
||||||
</ha-app-layout>
|
</ha-app-layout>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@ -443,10 +534,7 @@ class HUIRoot extends LitElement {
|
|||||||
if (!oldLovelace || oldLovelace.editMode !== this.lovelace!.editMode) {
|
if (!oldLovelace || oldLovelace.editMode !== this.lovelace!.editMode) {
|
||||||
const views = this.config && this.config.views;
|
const views = this.config && this.config.views;
|
||||||
|
|
||||||
// Adjust for higher header
|
fireEvent(this, "iron-resize");
|
||||||
if (!views || views.length < 2) {
|
|
||||||
fireEvent(this, "iron-resize");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Leave unused entities when leaving edit mode
|
// Leave unused entities when leaving edit mode
|
||||||
if (
|
if (
|
||||||
@ -643,12 +731,6 @@ class HUIRoot extends LitElement {
|
|||||||
unusedEntities.lovelace = this.lovelace!;
|
unusedEntities.lovelace = this.lovelace!;
|
||||||
unusedEntities.narrow = this.narrow;
|
unusedEntities.narrow = this.narrow;
|
||||||
});
|
});
|
||||||
if (this.config.background) {
|
|
||||||
unusedEntities.style.setProperty(
|
|
||||||
"--lovelace-background",
|
|
||||||
this.config.background
|
|
||||||
);
|
|
||||||
}
|
|
||||||
root.appendChild(unusedEntities);
|
root.appendChild(unusedEntities);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -675,7 +757,12 @@ class HUIRoot extends LitElement {
|
|||||||
const configBackground = viewConfig.background || this.config.background;
|
const configBackground = viewConfig.background || this.config.background;
|
||||||
|
|
||||||
if (configBackground) {
|
if (configBackground) {
|
||||||
view.style.setProperty("--lovelace-background", configBackground);
|
this._appLayout.style.setProperty(
|
||||||
|
"--lovelace-background",
|
||||||
|
configBackground
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this._appLayout.style.removeProperty("--lovelace-background");
|
||||||
}
|
}
|
||||||
|
|
||||||
root.appendChild(view);
|
root.appendChild(view);
|
||||||
@ -697,13 +784,19 @@ class HUIRoot extends LitElement {
|
|||||||
|
|
||||||
ha-app-layout {
|
ha-app-layout {
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
|
background: var(--lovelace-background);
|
||||||
}
|
}
|
||||||
ha-tabs {
|
ha-tabs {
|
||||||
margin-left: max(env(safe-area-inset-left), 24px);
|
width: 100%;
|
||||||
margin-right: max(env(safe-area-inset-right), 24px);
|
height: 100%;
|
||||||
|
margin-left: 4px;
|
||||||
--paper-tabs-selection-bar-color: var(--text-primary-color, #fff);
|
--paper-tabs-selection-bar-color: var(--text-primary-color, #fff);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
.edit-mode ha-tabs {
|
||||||
|
margin-left: max(env(safe-area-inset-left), 24px);
|
||||||
|
margin-right: max(env(safe-area-inset-right), 24px);
|
||||||
|
}
|
||||||
.edit-mode {
|
.edit-mode {
|
||||||
background-color: var(--dark-color, #455a64);
|
background-color: var(--dark-color, #455a64);
|
||||||
color: var(--text-dark-color);
|
color: var(--text-dark-color);
|
||||||
@ -738,7 +831,7 @@ class HUIRoot extends LitElement {
|
|||||||
color: var(--error-color);
|
color: var(--error-color);
|
||||||
}
|
}
|
||||||
#view {
|
#view {
|
||||||
min-height: calc(100vh - 112px);
|
min-height: calc(100vh - var(--header-height));
|
||||||
/**
|
/**
|
||||||
* Since we only set min-height, if child nodes need percentage
|
* Since we only set min-height, if child nodes need percentage
|
||||||
* heights they must use absolute positioning so we need relative
|
* heights they must use absolute positioning so we need relative
|
||||||
@ -761,9 +854,6 @@ class HUIRoot extends LitElement {
|
|||||||
flex: 1 1 100%;
|
flex: 1 1 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
#view.tabs-hidden {
|
|
||||||
min-height: calc(100vh - 64px);
|
|
||||||
}
|
|
||||||
.hide-tab {
|
.hide-tab {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,6 @@ export class MasonryView extends LitElement implements LovelaceViewElement {
|
|||||||
return css`
|
return css`
|
||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
background: var(--lovelace-background);
|
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
@ -131,7 +131,6 @@ export class PanelView extends LitElement implements LovelaceViewElement {
|
|||||||
return css`
|
return css`
|
||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
background: var(--lovelace-background);
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ class HaDialogShowAudioMessage extends LocalizeMixin(PolymerElement) {
|
|||||||
ha-paper-dialog {
|
ha-paper-dialog {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-height: calc(100% - 64px);
|
max-height: calc(100% - var(--header-height));
|
||||||
|
|
||||||
position: fixed !important;
|
position: fixed !important;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
|
@ -25,7 +25,7 @@ class HaPanelMap extends LocalizeMixin(PolymerElement) {
|
|||||||
return html`
|
return html`
|
||||||
<style include="ha-style">
|
<style include="ha-style">
|
||||||
#map {
|
#map {
|
||||||
height: calc(100vh - 64px);
|
height: calc(100vh - var(--header-height));
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
background: inherit;
|
background: inherit;
|
||||||
|
@ -137,7 +137,7 @@ class PanelMediaBrowser extends LitElement {
|
|||||||
--mdc-theme-primary: var(--app-header-text-color);
|
--mdc-theme-primary: var(--app-header-text-color);
|
||||||
}
|
}
|
||||||
ha-media-player-browse {
|
ha-media-player-browse {
|
||||||
height: calc(100vh - 64px);
|
height: calc(100vh - var(--header-height));
|
||||||
}
|
}
|
||||||
:host([narrow]) app-toolbar mwc-button {
|
:host([narrow]) app-toolbar mwc-button {
|
||||||
width: 65px;
|
width: 65px;
|
||||||
@ -145,6 +145,7 @@ class PanelMediaBrowser extends LitElement {
|
|||||||
.heading {
|
.heading {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
.heading .secondary-text {
|
.heading .secondary-text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
@ -48,6 +48,9 @@ documentContainer.innerHTML = `<custom-style>
|
|||||||
--primary-background-color: #fafafa;
|
--primary-background-color: #fafafa;
|
||||||
--secondary-background-color: #e5e5e5; /* behind the cards on state */
|
--secondary-background-color: #e5e5e5; /* behind the cards on state */
|
||||||
|
|
||||||
|
/* for header */
|
||||||
|
--header-height: 64px;
|
||||||
|
|
||||||
/* for label-badge */
|
/* for label-badge */
|
||||||
--label-badge-red: #DF4C1E;
|
--label-badge-red: #DF4C1E;
|
||||||
--label-badge-blue: #039be5;
|
--label-badge-blue: #039be5;
|
||||||
|
@ -112,12 +112,16 @@ export const haStyle = css`
|
|||||||
color: var(--app-header-text-color, white);
|
color: var(--app-header-text-color, white);
|
||||||
}
|
}
|
||||||
|
|
||||||
app-toolbar [main-title] {
|
app-toolbar {
|
||||||
margin-left: 20px;
|
height: var(--header-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-menu-button {
|
app-header div[sticky] {
|
||||||
margin-left: 4px;
|
height: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
app-toolbar [main-title] {
|
||||||
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
@ -277,7 +281,7 @@ export const haStyleDialog = css`
|
|||||||
max-width: calc(
|
max-width: calc(
|
||||||
100% - env(safe-area-inset-right) - env(safe-area-inset-left)
|
100% - env(safe-area-inset-right) - env(safe-area-inset-left)
|
||||||
) !important;
|
) !important;
|
||||||
max-height: calc(100% - 64px);
|
max-height: calc(100% - var(--header-height));
|
||||||
|
|
||||||
position: fixed !important;
|
position: fixed !important;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
|
@ -2279,6 +2279,7 @@
|
|||||||
"configure_ui": "Edit Dashboard",
|
"configure_ui": "Edit Dashboard",
|
||||||
"help": "Help",
|
"help": "Help",
|
||||||
"refresh": "Refresh",
|
"refresh": "Refresh",
|
||||||
|
"start_conversation": "Start conversation",
|
||||||
"reload_resources": "Reload resources",
|
"reload_resources": "Reload resources",
|
||||||
"exit_edit_mode": "Exit UI edit mode",
|
"exit_edit_mode": "Exit UI edit mode",
|
||||||
"close": "Close"
|
"close": "Close"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user