Make input select/textfield work better when bad REM defined (#219)

This commit is contained in:
Paulus Schoutsen 2022-04-13 14:01:56 -07:00 committed by GitHub
parent d87f076071
commit 627b106e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import { SelectBase } from "@material/mwc-select/mwc-select-base";
import { styles } from "@material/mwc-select/mwc-select.css";
import { css } from "lit";
declare global {
interface HTMLElementTagNameMap {
@ -8,7 +9,15 @@ declare global {
}
export class EwtSelect extends SelectBase {
static override styles = [styles];
static override styles = [
styles,
// rem -> em conversion
css`
.mdc-floating-label {
line-height: 1.15em;
}
`,
];
}
customElements.define("ewt-select", EwtSelect);

View File

@ -1,5 +1,6 @@
import { TextFieldBase } from "@material/mwc-textfield/mwc-textfield-base";
import { styles } from "@material/mwc-textfield/mwc-textfield.css";
import { css } from "lit";
declare global {
interface HTMLElementTagNameMap {
@ -8,7 +9,15 @@ declare global {
}
export class EwtTextfield extends TextFieldBase {
static override styles = [styles];
static override styles = [
styles,
// rem -> em conversion
css`
.mdc-floating-label {
line-height: 1.15em;
}
`,
];
}
customElements.define("ewt-textfield", EwtTextfield);

View File

@ -20,6 +20,8 @@ export const dialogStyles = css`
--mdc-typography-body1-line-height: 1.5em;
--mdc-typography-button-font-size: 0.875em;
--mdc-typography-button-line-height: 2.25em;
--mdc-typography-subtitle1-font-size: 1em;
--mdc-typography-subtitle1-line-height: 1.75em;
}
a {