<commit_before>//
// Copyright IBM Corp. 2016, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@import '../../globals/scss/vars';
@import '../../globals/scss/typography';
@import '../../globals/scss/helper-mixins';
@import '../../globals/scss/css--reset';
@import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once';

/// Form styles
/// @access private
/// @group form
@mixin form {
  .#{$prefix}--fieldset {
    @include reset;
    margin-bottom: $carbon--spacing-07;
  }

  .#{$prefix}--form-item {
    @include type-style('body-short-01');
    display: flex;
    flex-direction: column;
    // We specify `auto` as the default value so that the form item does
    // not collapse in IE11 due to a `flex-basis` of 0 only working with
    // `flex-direction: row`
    flex: 1 1 auto;
    align-items: flex-start;
  }

  .#{$prefix}--label {
    @include reset;
    @include type-style('label-01');

    color: $text-02;
    font-weight: $input-label-weight;
    display: inline-block;
    vertical-align: baseline;
    margin-bottom: $carbon--spacing-03;
    line-height: rem(16px);
  }

  .#{$prefix}--label .#{$prefix}--tooltip__trigger {
    // When tooltip trigger is put in form label the trigger button should fit in the size of label
    // https://github.com/IBM/carbon-components-react/issues/115
    @include type-style('label-01');
  }

  // Skeleton State
  .#{$prefix}--label.#{$prefix}--skeleton {
    @include skeleton;
    width: rem(75px);
    height: rem(14px);
  }

  input[type='number'] {
    font-family: carbon--font-family('mono');
  }

  input[data-invalid],
  .#{$prefix}--text-input__field-wrapper[data-invalid],
  .#{$prefix}--text-area__wrapper[data-invalid]
    > .#{$prefix}--text-area--invalid,
  .#{$prefix}--select-input__wrapper[data-invalid],
  .#{$prefix}--list-box[data-invalid],
  .#{$prefix}--combo-box[data-invalid] .#{$prefix}--text-input {
    @include focus-outline('invalid');
  }

  input[data-invalid],
  .#{$prefix}--text-input__field-wrapper[data-invalid],
  .#{$prefix}--text-area__wrapper[data-invalid],
  .#{$prefix}--select-input__wrapper[data-invalid],
  .#{$prefix}--time-picker[data-invalid],
  .#{$prefix}--list-box[data-invalid] {
    ~ .#{$prefix}--form-requirement {
      max-height: rem(200px);
      display: block;
      color: $text-error;
    }
  }

  //Fluid Form
  .#{$prefix}--form--fluid
    .#{$prefix}--text-input__field-wrapper[data-invalid] {
    display: block;
  }

  .#{$prefix}--form--fluid .#{$prefix}--fieldset {
    margin: 0;
  }

  .#{$prefix}--form--fluid input[data-invalid] {
    outline: none;
  }

  .#{$prefix}--form--fluid .#{$prefix}--form-requirement {
    margin: 0;
    padding: $carbon--spacing-03 rem(40px) $carbon--spacing-03
      $carbon--spacing-05;
  }

  // Fix for red ring when input is marked required in Firefox, refs #744
  input:not(output):not([data-invalid]):-moz-ui-invalid {
    box-shadow: none;
  }

  .#{$prefix}--form-requirement {
    @include reset;
    @include type-style('caption-01');
    margin: $carbon--spacing-02 0 0;
    max-height: 0;
    overflow: hidden;
    display: none;
  }

  .#{$prefix}--select--inline .#{$prefix}--form__helper-text {
    margin-top: 0;
  }

  .#{$prefix}--form__helper-text {
    @include type-style('helper-text-01');
    color: $text-02;
    z-index: 0;
    opacity: 1;
    margin-top: $carbon--spacing-02;
  }

  .#{$prefix}--label--disabled,
  .#{$prefix}--form__helper-text--disabled {
    color: $disabled-02;
  }
}
<commit_msg>fix(form): fix rerender issue with helpertext on safari (#6394)<commit_after>//
// Copyright IBM Corp. 2016, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@import '../../globals/scss/vars';
@import '../../globals/scss/typography';
@import '../../globals/scss/helper-mixins';
@import '../../globals/scss/css--reset';
@import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once';

/// Form styles
/// @access private
/// @group form
@mixin form {
  .#{$prefix}--fieldset {
    @include reset;

    margin-bottom: $carbon--spacing-07;
  }

  .#{$prefix}--form-item {
    @include type-style('body-short-01');

    display: flex;
    flex-direction: column;
    // We specify `auto` as the default value so that the form item does
    // not collapse in IE11 due to a `flex-basis` of 0 only working with
    // `flex-direction: row`
    flex: 1 1 auto;
    align-items: flex-start;
  }

  .#{$prefix}--label {
    @include reset;
    @include type-style('label-01');

    color: $text-02;
    font-weight: $input-label-weight;
    display: inline-block;
    vertical-align: baseline;
    margin-bottom: $carbon--spacing-03;
    line-height: rem(16px);
  }

  .#{$prefix}--label .#{$prefix}--tooltip__trigger {
    // When tooltip trigger is put in form label the trigger button should fit in the size of label
    // https://github.com/IBM/carbon-components-react/issues/115
    @include type-style('label-01');
  }

  // Skeleton State
  .#{$prefix}--label.#{$prefix}--skeleton {
    @include skeleton;

    width: rem(75px);
    height: rem(14px);
  }

  input[type='number'] {
    font-family: carbon--font-family('mono');
  }

  input[data-invalid],
  .#{$prefix}--text-input__field-wrapper[data-invalid],
  .#{$prefix}--text-area__wrapper[data-invalid]
    > .#{$prefix}--text-area--invalid,
  .#{$prefix}--select-input__wrapper[data-invalid],
  .#{$prefix}--list-box[data-invalid],
  .#{$prefix}--combo-box[data-invalid] .#{$prefix}--text-input {
    @include focus-outline('invalid');
  }

  input[data-invalid],
  .#{$prefix}--text-input__field-wrapper[data-invalid],
  .#{$prefix}--text-area__wrapper[data-invalid],
  .#{$prefix}--select-input__wrapper[data-invalid],
  .#{$prefix}--time-picker[data-invalid],
  .#{$prefix}--list-box[data-invalid] {
    ~ .#{$prefix}--form-requirement {
      max-height: rem(200px);
      display: block;
      color: $text-error;
    }
  }

  //Fluid Form
  .#{$prefix}--form--fluid
    .#{$prefix}--text-input__field-wrapper[data-invalid] {
    display: block;
  }

  .#{$prefix}--form--fluid .#{$prefix}--fieldset {
    margin: 0;
  }

  .#{$prefix}--form--fluid input[data-invalid] {
    outline: none;
  }

  .#{$prefix}--form--fluid .#{$prefix}--form-requirement {
    margin: 0;
    padding: $carbon--spacing-03 rem(40px) $carbon--spacing-03
      $carbon--spacing-05;
  }

  // Fix for red ring when input is marked required in Firefox, refs #744
  input:not(output):not([data-invalid]):-moz-ui-invalid {
    box-shadow: none;
  }

  .#{$prefix}--form-requirement {
    @include reset;
    @include type-style('caption-01');

    margin: $carbon--spacing-02 0 0;
    max-height: 0;
    overflow: hidden;
    display: none;
  }

  .#{$prefix}--select--inline .#{$prefix}--form__helper-text {
    margin-top: 0;
  }

  .#{$prefix}--form__helper-text {
    @include type-style('helper-text-01');

    color: $text-02;
    z-index: 0;
    opacity: 1;
    margin-top: $carbon--spacing-02;
    // Added to prevent error text from displaying under helper text in Safari (#6392)
    width: 100%;
  }

  .#{$prefix}--label--disabled,
  .#{$prefix}--form__helper-text--disabled {
    color: $disabled-02;
  }
}

{'fraction_non_alphanumeric': 0.19596151240005422, 'fraction_numerical': 0.020463477435966933, 'mean_word_length': 2.815925542916236, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6863', 'n_tokens_mistral': 2743, 'n_tokens_neox': 2489, 'n_words': 503}