ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
app/webpack/stylesheets/accessible-autocomplete.scss

Summary

Maintainability
Test Coverage
.autocomplete__wrapper {
  position: relative;
}

.autocomplete__hint,
.autocomplete__input {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 0;
  border: 2px solid;
  border-radius: 0;
  -webkit-appearance: none;
}

.autocomplete__input {
  position: relative;
  background-color: transparent;
}

.autocomplete__hint {
  position: absolute;
  color: #bfc1c3;
}

.autocomplete__input--default {
  padding: 4px;
}

.autocomplete__input--focused {
  outline: 3px solid #ffbf47;
  outline-offset: 0;
}

.autocomplete__input--show-all-values {
  padding: 4px 34px 4px 4px;
  cursor: pointer;
}

.autocomplete__dropdown-arrow-down {
  display: inline-block;
  position: absolute;
  z-index: -1;
  top: 10px;
  right: 8px;
  width: 24px;
  height: 24px;
}

.autocomplete__menu {
  width: 100%;
  width: calc(100% - 4px);
  max-height: 342px;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  border: 2px solid #0b0c0c;
  border-top: 0;
  color: #34384b;
  background-color: #ffffff;
}

.autocomplete__menu--visible {
  display: block;
}

.autocomplete__menu--hidden {
  display: none;
}

.autocomplete__menu--overlay {
  position: absolute;
  z-index: 100;
  top: 100%;
  left: 0;
  box-shadow: rgba(0, 0, 0, .2569) 0 2px 6px;
}

.autocomplete__menu--inline {
  position: relative;
}

.autocomplete__option {
  display: block;
  position: relative;
  border-bottom: solid #bfc1c3;
  border-width: 1px 0;
  cursor: pointer;
}

.autocomplete__option > * {
  pointer-events: none;
}

.autocomplete__option:first-of-type {
  border-top-width: 0;
}

.autocomplete__option:last-of-type {
  border-bottom-width: 0;
}

.autocomplete__option--odd {
  background-color: #fafafa;
}

.autocomplete__option--focused,
.autocomplete__option:hover {
  border-color: #005ea5;
  outline: 0;
  color: #ffffff;
  background-color: #005ea5;
}

.autocomplete__option--no-results {
  color: #646b6f;
  background-color: #fafafa;
  cursor: not-allowed;
}

.autocomplete__hint,
.autocomplete__input,
.autocomplete__option {
  font-size: 16px;
  line-height: 1.25;
}

.autocomplete__hint,
.autocomplete__option {
  padding: 4px;
}
@include govuk-media-query($from: tablet) {
  .autocomplete__hint,
  .autocomplete__input,
  .autocomplete__option {
    font-size: 19px;
    line-height: 1.3158;
  }
}