Fix panel view and backgrounds (#7181)

This commit is contained in:
Bram Kragten 2020-10-01 13:54:54 +02:00 committed by GitHub
parent 4289ff6652
commit ec920093d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 8 deletions

View File

@ -45,6 +45,8 @@ const showMediaPlayer = () => {
style.innerHTML = `
body {
--logo-image: url('https://www.home-assistant.io/images/home-assistant-logo.svg');
--logo-repeat: no-repeat;
--playback-logo-image: url('https://www.home-assistant.io/images/home-assistant-logo.svg');
--theme-hue: 200;
--progress-color: #03a9f4;
--splash-image: url('https://home-assistant.io/images/cast/splash.png');

View File

@ -137,9 +137,9 @@ export class MasonryView extends LitElement implements LovelaceViewElement {
| undefined;
if (
(changedProperties.has("lovelace") && (
oldLovelace?.config !== this.lovelace?.config ||
oldLovelace?.editMode !== this.lovelace?.editMode)) ||
(changedProperties.has("lovelace") &&
(oldLovelace?.config !== this.lovelace?.config ||
oldLovelace?.editMode !== this.lovelace?.editMode)) ||
changedProperties.has("_columns")
) {
this._createColumns();
@ -258,6 +258,12 @@ export class MasonryView extends LitElement implements LovelaceViewElement {
static get styles(): CSSResult {
return css`
:host {
display: block;
background: var(--lovelace-background);
height: 100%;
}
#badges {
margin: 8px 16px;
font-size: 85%;

View File

@ -40,11 +40,6 @@ export class PanelView extends LitElement implements LovelaceViewElement {
| HuiWarning
| HuiCardOptions;
public constructor() {
super();
this.style.setProperty("background", "var(--lovelace-background)");
}
public setConfig(_config: LovelaceViewConfig): void {}
protected updated(changedProperties: PropertyValues): void {
@ -108,6 +103,7 @@ export class PanelView extends LitElement implements LovelaceViewElement {
if (!this.lovelace?.editMode) {
this._card = card;
return;
}
const wrapper = document.createElement("hui-card-options");
@ -133,6 +129,12 @@ export class PanelView extends LitElement implements LovelaceViewElement {
static get styles(): CSSResult {
return css`
:host {
display: block;
background: var(--lovelace-background);
height: 100%;
}
mwc-fab {
position: sticky;
float: right;