Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ If a card inside the stack has the `--keep-background` CSS style defined, it wil
| `box_shadow` | boolean | **Optional** | Will keep the `box-shadow` on **all** the child cards | `false` |
| `margin` | boolean | **Optional** | Will keep the `margin` between **all** the child cards | `false` |
| `outer_padding` | boolean | **Optional** | Will add a `padding` of `8px` to the card if `margin` is `true` | `true` if `margin` is `true`, else false |
| `border` | boolean | **Optional** | Will keep the `border` on **all** the child cards | `false` |
| `border_radius` | boolean | **Optional** | Will keep the `border-radius` on **all** the child cards | `false` |

## Example
Expand Down
2 changes: 2 additions & 0 deletions src/stack-in-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class StackInCard extends LitElement implements LovelaceCard {
margin: false,
box_shadow: false,
border_radius: false,
border: false,
...config.keep,
},
};
Expand Down Expand Up @@ -96,6 +97,7 @@ class StackInCard extends LitElement implements LovelaceCard {
private _updateStyle(e: LovelaceCard | null, withBg: boolean): void {
if (!e) return;
if (!this._config?.keep?.box_shadow) e.style.boxShadow = 'none';
if (!this._config?.keep?.border) e.style.border = 'none';
if (
!this._config?.keep?.background &&
withBg &&
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface KeepConfig {
margin?: boolean;
background?: boolean;
box_shadow?: boolean;
border?: boolean;
border_radius?: boolean;
outer_padding?: boolean;
}