Skip to content

Commit

Permalink
feat: add configuration value to set full size card (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
idaho authored Dec 4, 2023
1 parent 1755fd4 commit 35fd092
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/cards/trash-card/trash-card-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ EntityWithOutIcon & {
waste?: TrashItem;
others?: TrashItem;
};
// eslint-disable-next-line @typescript-eslint/naming-convention
full_size?: boolean;
};

export const entityCardConfigStruct = assign(
Expand All @@ -31,6 +33,8 @@ export const entityCardConfigStruct = assign(
layout: optional(layoutStruct),
// eslint-disable-next-line @typescript-eslint/naming-convention
fill_container: optional(boolean()),
// eslint-disable-next-line @typescript-eslint/naming-convention
full_size: optional(boolean()),
settings: optional(
object({
organic: optional(
Expand Down
4 changes: 2 additions & 2 deletions src/cards/trash-card/trash-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class TrashCard extends LitElement implements LovelaceCard {
/* eslint-disable @typescript-eslint/naming-convention */
return html`
<ha-card
class=${classMap({ 'fill-container': appearance.fill_container })}
class=${classMap({ 'fill-container': appearance.fill_container, fullsize: this.config.full_size === true })}
style=${styleMap(backgroundStyle)}
>
<mushroom-card .appearance=${appearance} ?rtl=${rtl}>
Expand Down Expand Up @@ -401,7 +401,7 @@ export class TrashCard extends LitElement implements LovelaceCard {
`,
cardStyle,
css`
ha-card {
ha-card.fullsize {
margin-left: -17px;
margin-right: -17px;
margin-top: -4px;
Expand Down

0 comments on commit 35fd092

Please sign in to comment.