Files
web/packages/design-system/lib/components/Input/input.module.css
Bianca Widstam c1cae0db40 Merged in fix/height-input-select-fields (pull request #3146)
fix height value for input and select fields

* fix height value for input and select fields


Approved-by: Joakim Jäderberg
2025-11-13 10:26:58 +00:00

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;
}
}