From c4eb4cc5074d9e735a4d24d843d12ad2d8814809 Mon Sep 17 00:00:00 2001 From: unkn0wn Date: Tue, 23 Jun 2026 07:55:38 +0200 Subject: [PATCH] style: update textField styles --- src/components/textField/_textField.scss | 70 ++++++++++++++++++------ 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/src/components/textField/_textField.scss b/src/components/textField/_textField.scss index a4bca07..3f3dcff 100644 --- a/src/components/textField/_textField.scss +++ b/src/components/textField/_textField.scss @@ -1,30 +1,64 @@ -@use '../../styles/tokens/typography' as *; +@use "../../styles/tokens/typography" as *; .textField { display: flex; flex-direction: column; - gap: var(--nds-spacing-xs); + gap: var(--nds-spacing-2xs); + & label { + @include text-label; + color: var(--nds-text); + } + &__input, &__textarea { - background-color: var(--nds-color-background); - border: var(--nds-border-width-thin) solid var(--nds-text); - border-radius: var(--nds-radius-sm); - padding: var(--nds-spacing-sm) var(--nds-spacing-xs) ; + background-color: var(--nds-surface); + border: var(--nds-border-width-thin) solid var(--nds-border-strong); + border-radius: var(--nds-radius-md); + padding: 0 var(--nds-spacing-sm); @include text-base; color: var(--nds-text); - min-height: 50px; - max-width: 100%; + transition: + border-color 130ms ease, + box-shadow 130ms ease; + &::placeholder { + color: var(--nds-neutral); + } + &:hover { + border-color: var(--nds-neutral); + } + &:focus { + outline: none; + border-color: var(--nds-primary); + box-shadow: 0 0 0 3px var(--nds-ring); + } + &:disabled { + opacity: 0.55; + cursor: not-allowed; + } + } + &__input { + height: 38px; + } + &__textarea { + min-height: 84px; + padding: var(--nds-spacing-sm); + resize: vertical; + line-height: 1.5; } &__charCount { @include text-sm; - color: var(--nds-text-muted); - text-align: left; + color: var(--nds-neutral); + text-align: right; } - &__input { - background-color: var(--nds-color-background); - border: var(--nds-border-width-thin) solid var(--nds-text); - border-radius: var(--nds-radius-sm); - padding: var(--nds-spacing-sm) var(--nds-spacing-xs) ; - @include text-base; - color: var(--nds-text); + &__error { + @include text-sm; + color: var(--nds-error-medium); } -} \ No newline at end of file + &--invalid &__input, + &--invalid &__textarea { + border-color: var(--nds-error-medium); + &:focus { + box-shadow: 0 0 0 3px + color-mix(in srgb, var(--nds-error-medium) 35%, transparent); + } + } +}