diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-11-03 23:03:06 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:15:27 +0100 |
| commit | ce4a18899f24ba89b63ef743476ec0dbf1999ecf (patch) | |
| tree | 003a59ee62bc5f1f97110926559d941a978090ac /src/components/organisms/forms/search-form/search-form.module.scss | |
| parent | ddd45e29745b73e7fe1684e197dcff598b375644 (diff) | |
refactor(components): rewrite SearchForm component
* remove searchPage prop (the consumer should handle the submit)
* change onSubmit type
* use `useForm` hook to handle the form
Diffstat (limited to 'src/components/organisms/forms/search-form/search-form.module.scss')
| -rw-r--r-- | src/components/organisms/forms/search-form/search-form.module.scss | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/src/components/organisms/forms/search-form/search-form.module.scss b/src/components/organisms/forms/search-form/search-form.module.scss index 1315fde..db247a2 100644 --- a/src/components/organisms/forms/search-form/search-form.module.scss +++ b/src/components/organisms/forms/search-form/search-form.module.scss @@ -1,57 +1,60 @@ @use "../../../../styles/abstracts/functions" as fun; -@use "../../../../styles/abstracts/mixins" as mix; -.wrapper { - display: flex; - align-items: center; - position: relative; +.input { + border-right: none; +} - @include mix.media("screen") { - @include mix.dimensions("sm") { - max-width: 35ch; - } - } +.icon { + transform: scale(0.85); + transition: all 0.3s ease-in-out 0s; } .btn { - align-self: stretch; background: var(--color-bg-tertiary); border: fun.convert-px(2) solid var(--color-border); - border-left: none; box-shadow: fun.convert-px(3) fun.convert-px(3) 0 0 var(--color-shadow); transition: all 0.25s linear 0s; - &__icon { - transform: scale(0.85); - transition: all 0.3s ease-in-out 0s; + &:hover, + &:focus { + .icon { + transform: scale(0.85) rotate(20deg) translateX(#{fun.convert-px(2)}) + translateY(#{fun.convert-px(3)}); + } } &:focus { - outline: var(--color-primary-light) solid fun.convert-px(3); + outline: none; + border-color: var(--color-primary); + box-shadow: fun.convert-px(3) fun.convert-px(3) 0 0 + var(--color-primary-dark); } &:active { - outline: none; + .icon { + transform: scale(0.7); + } } +} + +.wrapper { + display: flex; - &:hover &, - &:focus & { - &__icon { - transform: scale(0.85) rotate(20deg) translateY(#{fun.convert-px(3)}); + &--no-label { + .btn { + align-self: stretch; } } - &:active & { - &__icon { - transform: scale(0.7); + &--has-label { + .btn { + align-self: flex-end; + height: fun.convert-px(52); } } } .field { - min-width: 0; - width: 100%; - &:focus-within ~ .btn { background: var(--color-bg); border-color: var(--color-primary); @@ -66,5 +69,10 @@ box-shadow: fun.convert-px(5) fun.convert-px(5) 0 fun.convert-px(1) var(--color-shadow); transform: translate(fun.convert-px(-3), fun.convert-px(-3)); + + &:focus { + box-shadow: fun.convert-px(5) fun.convert-px(5) 0 fun.convert-px(1) + var(--color-primary-dark); + } } } |
