.root { &.disabled { opacity: 0.3; pointer-events: none; } } .base { display: flex; align-items: center; gap: 8px; position: relative; &.default { padding: 13px 14px; } &.small { padding: 8px 14px; } } .input, .label { font-weight: 400; line-height: 24px; letter-spacing: 0.009em; color: #010500; &.default { font-size: 16px; } &.small { font-size: 14px; } } .input { padding: 0; background: transparent; border: none; outline: none; width: 100%; font: inherit; &:-webkit-autofill { background-clip: text; // transparent background on autocomplete } // hide number input buttons // chrome &::-webkit-outer-spin-button, &::-webkit-inner-spin-button { appearance: none; } // firefox &[type='number'] { appearance: textfield; } &:not(:focus) { &::placeholder { color: transparent; } } &:focus, &:not(:placeholder-shown) { ~ .label { opacity: 0; } ~ .fieldset { .legendLabel { opacity: 1; max-width: 100%; padding: 0 4px; } } } &:focus { ~ .fieldset { border-color: #00b387; .legendLabel { color: #00b387; } } } &.error { ~ .label { color: #fc174d; } ~ .fieldset { border-color: #fc174d; .legendLabel { color: #fc174d; } } } } .label { pointer-events: none; position: absolute; top: 50%; transform: translateY(-50%); } .fieldset { min-width: 0; margin: 0; padding: 0 13px; pointer-events: none; position: absolute; /* TODO: variables */ top: -6px; bottom: 0; left: 0; right: 0; border: 1px solid #0000003b; border-radius: 4px; } .legend, .message { font-size: 12px; font-weight: 400; line-height: 1; letter-spacing: 0.01em; } .legend { opacity: 0; max-width: 0.01px; height: 1em; padding: 0; color: #313635; } .message { margin: 4px 0 0 0; color: #fc174d; } .block { width: 100%; }