Skip to content

Commit

Permalink
Maintain card styles for custom:button-card
Browse files Browse the repository at this point in the history
  • Loading branch information
Sian-Lee-SA committed Aug 8, 2023
1 parent b316edb commit 3cd9c26
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion honeycomb-menu.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "honeycomb-menu",
"private": true,
"version": "0.13.0",
"version": "0.13.1",
"description": "Display a popup menu for Home Assistant lovelace cards via tap, hold or double tap",
"scripts": {
"build": "webpack",
Expand Down
12 changes: 10 additions & 2 deletions src/honeycomb-menu-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,21 @@ class HoneycombMenuItem extends LitElement
_createLovelaceCard()
{
if( ! this.config.type || this.config.type == 'custom:button-card' )
this.config.styles.card = [
{
if( ! this.config.styles )
this.config.styles = {}
if( ! Array.isArray(this.config.styles.card) )
this.config.styles.card = [];

this.config.styles.card.push(
{
height: '100%',
position: 'fixed',
padding: '0'
}
]
);
}

var card = createCard(merge({}, {
type: 'custom:button-card',
size: '30px',
Expand Down

0 comments on commit 3cd9c26

Please sign in to comment.