aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/fields/ChoiceField.scss
blob: 85986afaac57b4766d656ca07addee80519fab62 (plain) (blame)
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
@import "../../colors.scss";

.choice-field {
  font-size: 0.9em;

  .field-name {
    margin: 0;
  }

  .field-select {
    position: relative;
    margin-top: 5px;

    .field-value {
      padding: 7px 25px 7px 10px;
      cursor: pointer;
      color: $color-primary-4;
      border: none;
      border-radius: 5px;
      background-color: $color-primary-2;

      &::after {
        position: absolute;
        right: 10px;
        content: "⋎";
      }
    }

    .field-options {
      position: static;
      z-index: 100;
      top: 35px;
      display: none;
      width: 100%;
      border-top: 3px solid $color-primary-0;
      border-radius: 5px;
      background-color: $color-primary-2;

      .field-option {
        display: block;
        padding: 5px 10px;
        cursor: pointer;
        border-radius: 5px;
      }

      .field-option:hover {
        background-color: $color-primary-1;
      }
    }

    &:focus {
      outline: none;
    }
  }

  .field-select.select-expanded {
    .field-options {
      display: block;
    }

    .field-value::after {
      content: "⋏";
    }
  }

  &.field-small {
    font-size: 0.8em;
  }
}