<commit_before>/// Background color to use for invalid text inputs.
/// @type Color
$input-background-invalid: $alert-color;

/// Color to use for labels of invalid inputs.
/// @type Color
$form-label-color-invalid: $alert-color;

/// Default font color for form error text.
/// @type Color
$input-error-color: #fff !default;

/// Default background color for form error containers.
/// @type Color
$input-error-background: $alert-color !default;

/// Default font size for form error text.
/// @type Number
$input-error-font-size: rem-calc(12) !default;

/// Default padding inside form error containers.
/// @type Number
$input-error-padding: rem-calc(6 9 9) !default;

/// Styles the background and border of an input field to have an error state.
/// @param {Color} $background [$alert-color] - Color to use for the background and border.
@mixin form-input-error(
  $background: $alert-color
) {
  &:not(:focus) {
    background-color: rgba($background, 0.1);
    border-color: $background;
  }
}

/// Adds error styles to a form element, using the values in the settings file.
@mixin form-error {
  display: none;
  padding: $input-error-padding;
  margin-top: $form-spacing * -1;
  margin-bottom: $form-spacing;
  font-size: $input-error-font-size;
  color: $input-error-color;
  background: $input-error-background;
}

@mixin foundation-form-error {
  // Error class for invalid inputs
  .is-invalid-input {
    @include form-input-error;
  }

  // Error class for labels of invalid outputs
  .is-invalid-label {
    color: $form-label-color-invalid;
  }

  // Form error element
  .form-error {
    @include form-error;

    &.is-visible {
      display: block;
    }
  }
}<commit_msg>Simplify form error styles<commit_after>/// Sets if error styles should be added to inputs.
/// @type Boolean
$abide-inputs: true !default;

/// Sets if error styles should be added to labels.
/// @type Boolean
$abide-labels: true !default;

/// Background color to use for invalid text inputs.
/// @type Color
$input-background-invalid: $alert-color !default;

/// Color to use for labels of invalid inputs.
/// @type Color
$form-label-color-invalid: $alert-color !default;

/// Default font color for form error text.
/// @type Color
$input-error-color: $alert-color !default;

/// Default font size for form error text.
/// @type Number
$input-error-font-size: rem-calc(12) !default;

/// Default font weight for form error text.
/// @type Keyword
$input-error-font-weight: $global-weight-bold !default;

/// Styles the background and border of an input field to have an error state.
/// @param {Color} $background [$alert-color] - Color to use for the background and border.
@mixin form-input-error(
  $background: $alert-color
) {
  &:not(:focus) {
    background-color: rgba($background, 0.1);
    border-color: $background;
  }
}

/// Adds error styles to a form element, using the values in the settings file.
@mixin form-error {
  display: none;
  margin-top: $form-spacing * -0.5;
  margin-bottom: $form-spacing;
  font-size: $input-error-font-size;
  font-weight: $input-error-font-weight;
  color: $input-error-color;
}

@mixin foundation-form-error {
  @if $abide-inputs {
    // Error class for invalid inputs
    .is-invalid-input {
      @include form-input-error;
    }
  }

  @if $abide-labels {
    // Error class for labels of invalid outputs
    .is-invalid-label {
      color: $form-label-color-invalid;
    }
  }

  // Form error element
  .form-error {
    @include form-error;

    &.is-visible {
      display: block;
    }
  }
}
{'fraction_non_alphanumeric': 0.13975767821921667, 'fraction_numerical': 0.0039447731755424065, 'mean_word_length': 3.0249433106575965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3588504', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1112, 'n_words': 362}