mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-12 11:56:34 +00:00
Use FabBase
This commit is contained in:
parent
2040a49458
commit
a08a23a93d
@ -1,23 +1,25 @@
|
|||||||
import { Fab } from "@material/mwc-fab";
|
import { FabBase } from "@material/mwc-fab/mwc-fab-base";
|
||||||
|
import { styles } from "@material/mwc-fab/mwc-fab.css";
|
||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
import { css } from "lit";
|
import { css } from "lit";
|
||||||
|
|
||||||
@customElement("ha-fab")
|
@customElement("ha-fab")
|
||||||
export class HaFab extends Fab {
|
export class HaFab extends FabBase {
|
||||||
protected firstUpdated(changedProperties) {
|
protected firstUpdated(changedProperties) {
|
||||||
super.firstUpdated(changedProperties);
|
super.firstUpdated(changedProperties);
|
||||||
this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)");
|
this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)");
|
||||||
}
|
}
|
||||||
|
|
||||||
static override styles = Fab.styles.concat([
|
static override styles = [
|
||||||
|
styles,
|
||||||
css`
|
css`
|
||||||
.mdc-fab--extended .mdc-fab__icon {
|
.mdc-fab--extended .mdc-fab__icon {
|
||||||
margin-inline-start: -8px !important;
|
margin-inline-start: -8px;
|
||||||
margin-inline-end: 12px !important;
|
margin-inline-end: 12px;
|
||||||
direction: var(--direction) !important;
|
direction: var(--direction);
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
]);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user