summaryrefslogtreecommitdiffstats
path: root/src/components/Form/Form.module.scss
blob: 6ccdb11ebe1cf2e102507f18f5554852a204d583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@use "@styles/abstracts/functions" as fun;

.wrapper {
  width: 100%;

  &--search,
  &--toggle {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
  }

  &--toggle {
    position: relative;
    margin: var(--spacing-sm) 0;
  }

  &--centered {
    max-width: 45ch;
    margin-left: auto;
    margin-right: auto;
  }
}

.item {
  margin: var(--spacing-xs) 0;
  max-width: 45ch;
}

.field {
  width: 100%;
  padding: var(--spacing-2xs) var(--spacing-xs);
  background: var(--color-bg-tertiary);
  border: fun.convert-px(2) solid var(--color-border);
  box-shadow: fun.convert-px(3) fun.convert-px(3) 0 0 var(--color-shadow);
  transition: all 0.25s linear 0s;

  &:hover {
    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 {
    background: var(--color-bg);
    border-color: var(--color-primary-darker);
    box-shadow: 0 0 0 0 var(--color-shadow);
    transform: translate(#{fun.convert-px(3)}, #{fun.convert-px(3)});
    outline: none;
    transition: all 0.2s ease-in-out 0s, transform 0.3s ease-out 0s;
  }
}

.textarea {
  min-height: fun.convert-px(200);
}

.wrapper--search {
  > input {
    padding-right: calc(var(--btn-size) + var(--spacing-2xs));

    &:hover ~ button {
      transform: translate(fun.convert-px(-3), fun.convert-px(-3));
    }

    &:focus ~ button {
      transform: translate(fun.convert-px(3), fun.convert-px(3));
    }
  }
}