summaryrefslogtreecommitdiffstats
path: root/assets/sass/@primer/css/forms/input-group.scss
blob: 7cae4ee406cad4f96909f8addd8806b4771bd14c (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
.input-group {
  display: table;

  .form-control {
    position: relative;
    width: 100%;

    &:focus {
      z-index: 2;
    }

    + .btn {
      margin-left: 0;
    }
  }

  // For when you want the input group to behave like inline-block.
  &.inline {
    display: inline-table;
  }
}

.input-group .form-control,
.input-group-button {
  display: table-cell;
}

.input-group-button {
  width: 1%;
  vertical-align: middle; // Match the inputs
}

.input-group .form-control:first-child,
.input-group-button:first-child .btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group-button:first-child .btn {
  // stylelint-disable-next-line primer/spacing
  margin-right: -1px;
}

.input-group .form-control:last-child,
.input-group-button:last-child .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group-button:last-child .btn {
  // stylelint-disable-next-line primer/spacing
  margin-left: -1px;
}