TrestleAdmin/trestle

View on GitHub
frontend/css/components/_forms.scss

Summary

Maintainability
Test Coverage
.form-group {
  position: relative;
  margin-bottom: 0.875rem;

  &.has-error {
    > .form-label {
      color: $form-feedback-invalid-color;
    }

    > .invalid-feedback {
      display: block;
    }
  }
}

ul.invalid-feedback {
  list-style: none;
  margin-bottom: 0;
  padding-left: 0;
}

.form-text {
  color: $form-text-color;
  font-size: 0.8125rem;

  @include media-breakpoint-up(sm) {
    &.floating {
      position: absolute;
      top: 0;
      right: 0;
      margin: 0.125rem 0;
    }
  }
}

.form-label {
  display: block;
}

.control-label {
  @extend .form-label;
}

// Prevent input zooming on mobile devices
@include media-breakpoint-down(sm) {
  .form-control,
  .form-select,
  .input-group-text {
    font-size: 1rem;
  }
}