Fix mdc checkbox styling (#5897)

This commit is contained in:
Bram Kragten 2020-05-15 17:56:47 +02:00 committed by GitHub
parent 18a3f212f3
commit 5f46679d94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 14 deletions

View File

@ -1,7 +1,6 @@
import "@material/mwc-checkbox";
import type { Checkbox } from "@material/mwc-checkbox";
import { style } from "@material/mwc-checkbox/mwc-checkbox-css";
import { css, CSSResult, customElement } from "lit-element";
import { customElement } from "lit-element";
import type { Constructor } from "../types";
const MwcCheckbox = customElements.get("mwc-checkbox") as Constructor<Checkbox>;
@ -12,18 +11,6 @@ export class HaCheckbox extends MwcCheckbox {
super.firstUpdated();
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 {

View File

@ -48,6 +48,8 @@ export const derivedStyles = {
"material-body-text-color": "var(--primary-text-color)",
"material-background-color": "var(--card-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`