FarmBot/Farmbot-Web-App

View on GitHub
frontend/css/inputs.scss

Summary

Maintainability
Test Coverage
// Styles for INPUTS
input:not([role="combobox"]) {
  font-size: 1.2rem;
  color: $dark_gray;
  height: auto;
  width: 100%;
  border: 0;
  padding: 6px 8px;
  box-shadow: 0px 0px 10px $light_gray;
  &[type="checkbox"] {
    width: inherit;
  }
  &:focus {
    background-color: $white;
    box-shadow: 0px 0px 10px $translucent;
  }
  &.bulk-day-selector {
    width: 10%;
    box-shadow: none;
    margin-bottom: 0.75rem !important;
    margin-top: 0.75rem !important;
    height: 1.5rem;
    vertical-align: top;
    &.margin-left {
      margin-left: 20%;
    }
  }
  &.day {
    display: none;
  }
  &.dim {
    background: darken($white, 2%) !important;
    &.gray {
      background: darken($medium_light_gray, 2%) !important;
    }
  }
  &.error {
    border: 2px solid $red;
    background-color: $white !important;
    color: $red;
  }
  &:not([type="checkbox"]):not([type="radio"]) {
    -moz-appearance: textfield;
  }
}

input:not([role="combobox"]):not([type="checkbox"]):not([type="radio"]) {
  height: 3rem;
}

.input {
  position: relative;
  .bp5-popover-wrapper {
    position: unset;
  }
}

.input-error-wrapper {
  height: 0;
  .bp5-popover-content {
    min-width: 120px;
  }
  .bp5-overlay {
    display: inline-block;
  }
}

.input-error {
  position: absolute;
  top: 0;
  right: 0;
  width: 15px;
  height: 15px;
  color: $white;
  background: $red;
  padding: 2px;
  font-size: 12px;
}

.day-selector-wrapper {
  display: inline-block;
  width: 10%;
  height: 3rem;
}

.week-row {
  height: 30.5px;
  width: 108%;
  margin-left: -1rem;
}

select {
  border: none;
  padding: 7px;
  background: $white;
  width: 100%;
}

.filter-search {
  span {
    width: 100%;
    color: $dark_gray;
  }
  .bp5-popover-target {
    position: relative;
  }
  i {
    position: absolute;
    right: 1rem;
    line-height: 3rem;
    color: $dark_gray
  }
  &.dim {
    Button {
      background: darken($white, 2%) !important;
      &:hover {
        background: darken($white, 2%) !important;
      }
    }
  }
  &.disabled {
    pointer-events: none;
    button {
      background: darken($white, 10%) !important;
    }
  }
  &.warning {
    button {
      background: $light_red !important;
      border: 3px solid $red !important;
      &:hover {
        background: $light_red !important;
      }
    }
  }
}

.filter-search-popover {
  .bp5-popover-content {
    max-width: 40rem;
    padding: 0;
    .bp5-menu {
      padding-left: 0;
      padding-right: 0;
    }
    .bp5-input {
      height: auto !important;
    }
  }
  &.few-items {
    .bp5-input-group {
      display: none;
    }
  }
}

.filter-search-item {
  padding-left: 1rem;
  font-weight: normal !important;
  .bp5-text-overflow-ellipsis {
    white-space: normal;
    padding-left: 1rem;
    text-indent: -1rem;
  }
}

.filter-search-item-none::after {
  content: "*";
}

.filter-search-heading-item {
  pointer-events: none;
  font-weight: bold !important;
  border-bottom: 1px solid $gray;
}

.fb-checkbox {
  input[type="checkbox"] {
    position: relative;
    border-radius: 0;
    -webkit-appearance: none;
    border: 0.5px solid $gray;
    width: 2rem;
    height: 2rem;
    background: $white;
    margin-top: 0;
    cursor: pointer;
    &:before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: $white;
      opacity: 0.5;
    }
    &:checked:after {
      content: "";
      position: absolute;
      left: 0.5rem;
      bottom: 0.5rem;
      border: solid $dark_gray;
      border-width: 0 3px 3px 0;
      transform: rotate(45deg);
      padding: 0.6rem 0.3rem;
    }
  }
  &.partial:after {
    content: "";
    position: absolute;
    left: 0.75rem;
    bottom: 1.2rem;
    border: solid $dark_gray;
    border-width: 0 0 3px 0;
    padding: 0.6rem 0.3rem;
  }
  &.large {
    input[type="checkbox"] {
      width: 3rem;
      height: 3rem;
      &:checked:after {
        content: "";
        position: absolute;
        left: 0.9rem;
        bottom: 0.5rem;
        border: solid $dark_gray;
        border-width: 0 4px 4px 0;
        transform: rotate(45deg);
        padding: 1rem 0.3rem;
      }
    }
  }
  &.disabled {
    cursor: not-allowed;
    input[type="checkbox"] {
      background: $light_gray;
      pointer-events: none;
      &:checked:after {
        border-color: $gray;
     }
    }
  }
}