Skip to content

Commit

Permalink
Styles and custom styles update for the HBS
Browse files Browse the repository at this point in the history
  • Loading branch information
Clooos authored Feb 15, 2024
1 parent 9c6a559 commit 5b1c0b7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,8 @@ To change the background color of a single button in an `horizontal-buttons-stac
```yaml
styles: >
/* Selector for the '#kitchen' button */
.kitchen {
background: darkblue !important;
.kitchen > .color-background {
background-color: blue !important;
}
```

Expand Down Expand Up @@ -582,6 +582,15 @@ But in all cards you can also use this:
`hass.states['light.kitchen'].state` will return the state of `light.kitchen`.
`hass.states['light.kitchen'].attributes.brightness` will return the brightness attribute of `light.kitchen`.

Here is an example on how you can change the background color of a button based on an entity for the horizontal buttons stack:

```yaml
styles: |
.kitchen > .color-background {
background-color: ${hass.states['light.kitchen'].state === 'on' ? 'blue' : 'red'} !important;
}
```

## Custom components conflicts

⚠️ For now there are some features that are not working with:
Expand Down

0 comments on commit 5b1c0b7

Please sign in to comment.