Lovelace background theme (#10283)

* Remove background from examples

* Update views.markdown
This commit is contained in:
Bram Kragten 2019-09-03 13:18:26 +02:00 committed by Franck Nijhof
parent 0fda093e6d
commit 1089948089
2 changed files with 14 additions and 16 deletions

View File

@ -103,17 +103,6 @@ This renders the first card on full width, other cards in this view will not be
- zone.home - zone.home
``` ```
## Background
Style the background of views using [CSS](https://en.wikipedia.org/wiki/Cascading_Style_Sheets). For wallpapers you probably want to use the example below, more options can be found [here](https://developer.mozilla.org/en-US/docs/Web/CSS/background).
### Example
```yaml
- title: Living room
background: center / cover no-repeat url("/local/background.png") fixed
```
## Themes ## Themes
Set a separate [theme](/components/frontend/#themes) for the view and its cards. Set a separate [theme](/components/frontend/#themes) for the view and its cards.
@ -124,3 +113,17 @@ Set a separate [theme](/components/frontend/#themes) for the view and its cards.
- title: Home - title: Home
theme: happy theme: happy
``` ```
### Background
You can style the background of your views with a [theme](/components/frontend/#themes). You can use the CSS variable `lovelace-background`. For wallpapers you probably want to use the example below, more options can be found [here](https://developer.mozilla.org/en-US/docs/Web/CSS/background).
#### Example
```yaml
# Example configuration.yaml entry
frontend:
themes:
example:
lovelace-background: center / cover no-repeat url("/local/background.png") fixed
```

View File

@ -38,16 +38,11 @@ resources:
- url: /local/my-webfont.css - url: /local/my-webfont.css
type: css type: css
# Optional background for all views. Check https://developer.mozilla.org/en-US/docs/Web/CSS/background for more examples.
background: center / cover no-repeat url("/background.png") fixed
views: views:
# View tab title. # View tab title.
- title: Example - title: Example
# Unique path for direct access /lovelace/${path} # Unique path for direct access /lovelace/${path}
path: example path: example
# Optional background (overwrites the global background).
background: radial-gradient(crimson, skyblue)
# Each view can have a different theme applied. Theme should be defined in the frontend. # Each view can have a different theme applied. Theme should be defined in the frontend.
theme: dark-mode theme: dark-mode
# The cards to show on this view. # The cards to show on this view.