mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-08 18:06:36 +00:00
Fix mdc checkbox styling (#5897)
This commit is contained in:
parent
18a3f212f3
commit
5f46679d94
@ -1,7 +1,6 @@
|
|||||||
import "@material/mwc-checkbox";
|
import "@material/mwc-checkbox";
|
||||||
import type { Checkbox } from "@material/mwc-checkbox";
|
import type { Checkbox } from "@material/mwc-checkbox";
|
||||||
import { style } from "@material/mwc-checkbox/mwc-checkbox-css";
|
import { customElement } from "lit-element";
|
||||||
import { css, CSSResult, customElement } from "lit-element";
|
|
||||||
import type { Constructor } from "../types";
|
import type { Constructor } from "../types";
|
||||||
|
|
||||||
const MwcCheckbox = customElements.get("mwc-checkbox") as Constructor<Checkbox>;
|
const MwcCheckbox = customElements.get("mwc-checkbox") as Constructor<Checkbox>;
|
||||||
@ -12,18 +11,6 @@ export class HaCheckbox extends MwcCheckbox {
|
|||||||
super.firstUpdated();
|
super.firstUpdated();
|
||||||
this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)");
|
this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static get styles(): CSSResult[] {
|
|
||||||
return [
|
|
||||||
style,
|
|
||||||
css`
|
|
||||||
.mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate)
|
|
||||||
~ .mdc-checkbox__background {
|
|
||||||
border-color: rgba(var(--rgb-primary-text-color), 0.54);
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
@ -48,6 +48,8 @@ export const derivedStyles = {
|
|||||||
"material-body-text-color": "var(--primary-text-color)",
|
"material-body-text-color": "var(--primary-text-color)",
|
||||||
"material-background-color": "var(--card-background-color)",
|
"material-background-color": "var(--card-background-color)",
|
||||||
"material-secondary-background-color": "var(--secondary-background-color)",
|
"material-secondary-background-color": "var(--secondary-background-color)",
|
||||||
|
"mdc-checkbox-unchecked-color": "rgba(var(--rgb-primary-text-color), 0.54)",
|
||||||
|
"mdc-checkbox-disabled-color": "var(--disabled-text-color)",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const haStyle = css`
|
export const haStyle = css`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user