mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-09 18:36:35 +00:00
Lovelace: Style view backgroud (#1408)
* Lovelace: Style view backgroud based on: #1403 fix: https://github.com/home-assistant/ui-schema/issues/30 ```yaml background: center / cover no-repeat url("https://images.pexels.com/photos/977736/pexels-photo-977736.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260") background: radial-gradient(crimson, skyblue) background: orange ``` * Reset background if not defined * Simplify * Lint * Add global backround * Fix backround in unused entities * Lint
This commit is contained in:
parent
cb60904912
commit
10009eea2e
@ -198,6 +198,7 @@ class HUIRoot extends NavigateMixin(EventsMixin(PolymerElement)) {
|
||||
}
|
||||
|
||||
let view;
|
||||
let background = this.config.background || '';
|
||||
|
||||
if (viewIndex === 'unused') {
|
||||
view = document.createElement('hui-unused-entities');
|
||||
@ -211,8 +212,11 @@ class HUIRoot extends NavigateMixin(EventsMixin(PolymerElement)) {
|
||||
view.config = viewConfig;
|
||||
view.columns = this.columns;
|
||||
}
|
||||
if (viewConfig.background) background = viewConfig.background;
|
||||
}
|
||||
|
||||
this.$.view.style.background = background;
|
||||
|
||||
view.hass = this.hass;
|
||||
root.appendChild(view);
|
||||
}
|
||||
|
@ -12,7 +12,8 @@ class HuiUnusedEntities extends PolymerElement {
|
||||
<style>
|
||||
#root {
|
||||
max-width: 600px;
|
||||
margin: 8px auto;
|
||||
margin: 0 auto;
|
||||
padding: 8px 0;
|
||||
}
|
||||
</style>
|
||||
<div id="root"></div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user