fix height value for input and select fields * fix height value for input and select fields Approved-by: Joakim Jäderberg
65 lines
1.4 KiB
CSS
65 lines
1.4 KiB
CSS
.container {
|
|
align-content: center;
|
|
background-color: var(--Surface-Primary-Default);
|
|
border: 1px solid var(--Border-Interactive-Default);
|
|
border-radius: var(--Corner-radius-md);
|
|
display: grid;
|
|
min-width: 0; /* allow shrinkage */
|
|
height: 56px;
|
|
padding: 0 var(--Space-x15);
|
|
box-sizing: border-box;
|
|
cursor: text;
|
|
|
|
.container:has(.input:focus):not(:has(.input:disabled)),
|
|
.container:has(.input:focus):not(:has(.input:read-only)) {
|
|
outline-offset: -2px;
|
|
outline: 2px solid var(--Border-Interactive-Focus);
|
|
}
|
|
|
|
&:has(.input:disabled),
|
|
&:has(.input:read-only) {
|
|
background-color: var(--Surface-Primary-Disabled);
|
|
border: transparent;
|
|
cursor: unset;
|
|
}
|
|
|
|
&:has(.input[data-invalid='true'], .input[aria-invalid='true']) {
|
|
border-color: var(--Border-Interactive-Error);
|
|
|
|
&:focus-within {
|
|
outline-offset: -2px;
|
|
outline: 2px solid var(--Border-Interactive-Error);
|
|
}
|
|
}
|
|
}
|
|
|
|
.input {
|
|
background: none;
|
|
border: none;
|
|
color: var(--Text-Default);
|
|
height: 1px;
|
|
order: 2;
|
|
padding: 0;
|
|
transition: height 150ms ease;
|
|
|
|
&:focus,
|
|
&:placeholder-shown,
|
|
&[value]:not([value='']) {
|
|
height: 24px;
|
|
outline: none;
|
|
}
|
|
|
|
&:disabled,
|
|
&:read-only {
|
|
color: var(--Text-Interactive-Disabled);
|
|
cursor: unset;
|
|
}
|
|
}
|
|
|
|
@media (hover: hover) {
|
|
.input:active:not(:disabled) {
|
|
height: 24px;
|
|
outline: none;
|
|
}
|
|
}
|