summaryrefslogtreecommitdiff
path: root/src/components/Field.module.scss
blob: 72a51497fa9543f17aa5db6708277d01ebb7825d (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
.root {
  position: relative;
  padding: 10px 0;
  input {
    -webkit-appearance: none;
    background-color: transparent;
    background-image: none;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--color-input-border);
    box-sizing: border-box;
    color: inherit;
    display: inline-block;
    font-size: inherit;
    height: 40px;
    outline: none;
    padding: 0 4px;
    width: 100%;
    &:focus {
      border-color: var(--color-focus-blue);
    }
  }

  label {
    position: absolute;
    left: 5px;
    bottom: 22px;
    transition: transform 150ms ease-in-out;
    transform-origin: 0 0;
    font-size: 0.9em;
    &.floatAbove {
      transform: scale(0.75) translateY(-25px);
    }
  }

  input {
    &:focus + label {
      color: var(--color-focus-blue);
      transform: scale(0.75) translateY(-25px);
    }
  }
}