Add styling to popups

This commit is contained in:
2022-07-24 20:27:13 +00:00
parent d58a29f4f9
commit 0b195e8841
4 changed files with 23 additions and 7 deletions

View File

@@ -24,7 +24,7 @@ import { BrowserIDMixin } from "./browserID";
x Device -> Browser
- Popups
X Basic popups
- Card-mod integration
x Styling
X Timeout
X Fullscreen
x Popup-card

View File

@@ -18,6 +18,7 @@ class BrowserModPopup extends LitElement {
timeout;
_timeoutStart;
_timeoutTimer;
@property() _style;
closeDialog() {
this.open = false;
@@ -50,6 +51,7 @@ class BrowserModPopup extends LitElement {
timeout = undefined,
timeout_action = undefined,
size = undefined,
style = undefined,
} = {}
) {
this.title = title;
@@ -81,6 +83,7 @@ class BrowserModPopup extends LitElement {
};
this.wide = size === "wide" ? "" : undefined;
this.fullscreen = size === "fullscreen" ? "" : undefined;
this._style = style;
}
_primary() {
@@ -153,6 +156,9 @@ class BrowserModPopup extends LitElement {
></mwc-button>
`
: ""}
<style>
${this._style}
</style>
</ha-dialog>
`;
}
@@ -303,8 +309,7 @@ export const PopupMixin = (SuperClass) => {
// },
// ""
// );
this._popupEl.setupDialog(...args);
this._popupEl.openDialog();
this._popupEl.setupDialog(...args).then(() => this._popupEl.openDialog());
}
closePopup(...args) {