Skip to content

Commit

Permalink
Make it possible for themes to blur backgrounds (#20447)
Browse files Browse the repository at this point in the history
* Make it possible for themes to blur card backgrounds

* Make it possible for themes to blur dialog backgrounds

* Add ha prefix

Co-authored-by: Bram Kragten <[email protected]>

* Rename dialog-backdrop-filter to ha-dialog-scrim-backdrop-filter

With backwards compatibility

* Run prettier

---------

Co-authored-by: Bram Kragten <[email protected]>
  • Loading branch information
Nezz and bramkragten authored Apr 10, 2024
1 parent 9903e22 commit bf176ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/components/ha-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export class HaCard extends LitElement {
--ha-card-background,
var(--card-background-color, white)
);
-webkit-backdrop-filter: var(--ha-card-backdrop-filter, none);
backdrop-filter: var(--ha-card-backdrop-filter, none);
box-shadow: var(--ha-card-box-shadow, none);
box-sizing: border-box;
border-radius: var(--ha-card-border-radius, 12px);
Expand Down
12 changes: 10 additions & 2 deletions src/components/ha-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@ export class HaDialog extends DialogBase {
var(--divider-color)
);
z-index: var(--dialog-z-index, 8);
-webkit-backdrop-filter: var(--dialog-backdrop-filter, none);
backdrop-filter: var(--dialog-backdrop-filter, none);
-webkit-backdrop-filter: var(
--ha-dialog-scrim-backdrop-filter,
var(--dialog-backdrop-filter, none)
);
backdrop-filter: var(
--ha-dialog-scrim-backdrop-filter,
var(--dialog-backdrop-filter, none)
);
--mdc-dialog-box-shadow: var(--dialog-box-shadow, none);
--mdc-typography-headline6-font-weight: 400;
--mdc-typography-headline6-font-size: 1.574rem;
Expand Down Expand Up @@ -119,6 +125,8 @@ export class HaDialog extends DialogBase {
margin-top: var(--dialog-surface-margin-top);
min-height: var(--mdc-dialog-min-height, auto);
border-radius: var(--ha-dialog-border-radius, 28px);
-webkit--filter: var(--ha-dialog-surface--filter, none);
-filter: var(--ha-dialog-surface--filter, none);
}
:host([flexContent]) .mdc-dialog .mdc-dialog__content {
display: flex;
Expand Down

0 comments on commit bf176ac

Please sign in to comment.