search.scss 5.09 KB
Newer Older
1 2
.search-results {
  .search-result-row {
3 4 5 6 7 8 9
    border-bottom: 1px solid $border-color;
    padding-bottom: $gl-padding;
    margin-bottom: $gl-padding;

    &:last-child {
      border-bottom: none;
    }
10
  }
11 12 13 14

  .blob-result {
    margin: 5px 0;
  }
15
}
16

17 18 19 20 21 22 23 24 25 26
.search form:hover,
.file-finder-input:hover,
.issuable-search-form:hover,
.search-text-input:hover,
.form-control:hover {
  border-color: lighten($dropdown-input-focus-border, 20%);
  box-shadow: 0 0 4px lighten($search-input-focus-shadow-color, 20%);
}

input[type="checkbox"]:hover {
dimitrieh's avatar
dimitrieh committed
27
  box-shadow: 0 0 2px 2px lighten($search-input-focus-shadow-color, 20%), 0 0 0 1px lighten($search-input-focus-shadow-color, 20%);
28 29
}

30
.search {
31
  margin: 4px 8px 0;
32 33 34 35 36

  form {
    @extend .form-control;
    margin: 0;
    padding: 4px;
37
    width: $search-input-width;
Alfredo Sumaran's avatar
Alfredo Sumaran committed
38
    line-height: 24px;
39 40 41
    height: 32px;
    border: 0;
    border-radius: $border-radius-default;
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
42
    transition: border-color ease-in-out $default-transition-duration, background-color ease-in-out $default-transition-duration;
43 44

    &:hover {
45
      box-shadow: none;
46
    }
47 48
  }

49
  .location-badge {
Annabel Dunstone Gray's avatar
Fixes  
Annabel Dunstone Gray committed
50
    height: 32px;
51 52 53 54
    font-size: 12px;
    margin: -4px 4px -4px -4px;
    line-height: 25px;
    padding: 4px 8px;
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
55 56
    border-radius: $border-radius-default 0 0 $border-radius-default;
    transition: border-color ease-in-out $default-transition-duration;
57 58 59 60 61
  }

  .search-input {
    border: none;
    font-size: 14px;
62
    padding: 0 20px 0 0;
Alfredo Sumaran's avatar
Alfredo Sumaran committed
63
    margin-left: 5px;
64
    line-height: 25px;
65
    width: 98%;
66 67
    color: $white-light;
    background: none;
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
68
    transition: color ease-in-out $default-transition-duration;
69 70
  }

71
  .search-input::placeholder {
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
72
    transition: color ease-in-out $default-transition-duration;
73 74 75 76
  }

  .search-input-container {
    display: flex;
77
    position: relative;
78 79
  }

80
  .search-input-wrap {
81 82
    .search-icon,
    .clear-icon {
Alfredo Sumaran's avatar
Alfredo Sumaran committed
83 84
      position: absolute;
      right: 5px;
85
      top: 4px;
Alfredo Sumaran's avatar
Alfredo Sumaran committed
86 87
    }

88
    .search-icon {
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
89
      transition: color $default-transition-duration;
90 91 92 93 94 95 96 97 98
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
    }

    .clear-icon {
      display: none;
    }

99 100 101 102 103
    // Rewrite position. Dropdown menu should be relative to .search-input-container
    .dropdown {
      position: static;
    }

104 105 106
    .dropdown-header {
      text-transform: uppercase;
      font-size: 11px;
Alfredo Sumaran's avatar
Alfredo Sumaran committed
107
    }
Alfredo Sumaran's avatar
Alfredo Sumaran committed
108 109 110

    // Custom dropdown positioning
    .dropdown-menu {
111 112 113 114 115 116 117
      transition-property: opacity, transform;
      transition-duration: 250ms, 250ms;
      transition-delay: 0ms, 25ms;
      transition-timing-function: $dropdown-animation-timing;
      transform: translateY(0);
      opacity: 0;
      display: block;
Alfredo Sumaran's avatar
Alfredo Sumaran committed
118
      left: -5px;
119 120 121 122 123 124 125 126
      padding: 0;

      ul {
        padding: 10px 0;
      }
    }

    .dropdown-content {
Alfredo Sumaran's avatar
Alfredo Sumaran committed
127
      max-height: 350px;
Alfredo Sumaran's avatar
Alfredo Sumaran committed
128
    }
129
  }
130 131 132 133

  &.search-active {
    form {
      @extend .form-control:focus;
134
      border-color: $dropdown-input-focus-border;
135 136 137 138 139 140
      box-shadow: none;

      .search-input-wrap {
        .search-icon,
        .clear-icon {
          color: $gl-text-color-tertiary;
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
141
          transition: color ease-in-out $default-transition-duration;
142 143 144 145 146
        }
      }

      .search-input {
        color: $gl-text-color;
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
147
        transition: color ease-in-out $default-transition-duration;
148 149 150 151 152
      }

      .search-input::placeholder {
        color: $gl-text-color-tertiary;
      }
153 154 155
    }

    .location-badge {
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
156
      transition: all $default-transition-duration;
157 158
      background-color: $nav-badge-bg;
      border-color: $border-color;
159
    }
160 161 162 163

    .dropdown-menu {
      transition-duration: 100ms, 75ms;
      transition-delay: 75ms, 100ms;
164
      transform: translateY(7px);
165 166
      opacity: 1;
    }
167
  }
168

169 170 171 172
  &.has-value {
    .search-icon {
      display: none;
    }
173

174 175 176
    .clear-icon {
      cursor: pointer;
      display: block;
177 178 179
    }
  }

180 181
  &.has-location-badge {
    .search-input-wrap {
182
      width: 68%;
183 184
    }
  }
185
}
Phil Hughes's avatar
Phil Hughes committed
186 187

.search-holder {
188 189
  @include new-style-dropdown;

Phil Hughes's avatar
Phil Hughes committed
190 191
  @media (min-width: $screen-sm-min) {
    display: -webkit-flex;
Phil Hughes's avatar
Phil Hughes committed
192
    display: flex;
Phil Hughes's avatar
Phil Hughes committed
193
  }
Phil Hughes's avatar
Phil Hughes committed
194

195 196
  .search-field-holder,
  .project-filter-form {
Phil Hughes's avatar
Phil Hughes committed
197 198
    -webkit-flex: 1 0 auto;
    flex: 1 0 auto;
Phil Hughes's avatar
Phil Hughes committed
199
    position: relative;
Phil Hughes's avatar
Phil Hughes committed
200 201 202 203 204
    margin-right: 0;

    @media (min-width: $screen-sm-min) {
      margin-right: 5px;
    }
Phil Hughes's avatar
Phil Hughes committed
205 206
  }

Phil Hughes's avatar
Phil Hughes committed
207 208 209 210 211 212 213 214
  .search-icon {
    position: absolute;
    left: 10px;
    top: 10px;
    color: $gray-darkest;
    pointer-events: none;
  }

215 216
  .search-text-input,
  .project-filter-form-field {
Phil Hughes's avatar
Phil Hughes committed
217 218 219 220
    padding-left: $gl-padding + 15px;
    padding-right: $gl-padding + 15px;
  }

221 222
  .btn-search,
  .btn-new {
Phil Hughes's avatar
Phil Hughes committed
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
    width: 100%;
    margin-top: 5px;

    @media (min-width: $screen-sm-min) {
      width: auto;
      margin-top: 0;
      margin-left: 5px;
    }
  }

  .dropdown {
    @media (min-width: $screen-sm-min) {
      margin-left: 5px;
      margin-right: 5px;
    }
  }

  .dropdown-menu-toggle {
    width: 100%;
    margin-top: 5px;

    @media (min-width: $screen-sm-min) {
245
      width: 180px;
Phil Hughes's avatar
Phil Hughes committed
246 247
      margin-top: 0;
    }
Phil Hughes's avatar
Phil Hughes committed
248 249
  }
}
Phil Hughes's avatar
Phil Hughes committed
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265

.search-clear {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 0;
  color: $gray-darkest;
  line-height: 0;
  background: none;
  border: 0;

  &:hover,
  &:focus {
    color: $gl-link-color;
  }
}