<commit_before>/*----------------------------------------*\
  FORMS
\*----------------------------------------*/

// Prepare some required values
// Find the field border "width" from $field-border parameter
$field-border-width: 0;
$field-border-width-small: 0;
$field-border-width-large: 0;

@each $value in $field-border {
  @if type-of($value) == 'number' {
    $field-border-width: $value;
    $field-border-width-small: $value;
    $field-border-width-large: $value;
  }
}
@each $value in $field-small-border {
  @if type-of($value) == 'number' {
    $field-border-width-small: $value;
  }
}
@each $value in $field-large-border {
  @if type-of($value) == 'number' {
    $field-border-width-large: $value;
  }
}

// Determine the amount of vertical padding for further calculation
$padding-vertical: 0;
$padding-vertical-small: 0;
$padding-vertical-large: 0;

$padding-vertical: total-vertical-padding($field-padding);
$padding-vertical-small: total-vertical-padding($field-small-padding);
$padding-vertical-large: total-vertical-padding($field-large-padding);

// In case the fields font-size is a number (ie. not 'inherit'), use it instead of default font-size for calculation
$field-calc-font-size: $font-size-default;

@if (type-of($field-font-size) == 'number') {
  $field-calc-font-size: $field-font-size;
}


/**
 * Fields
 */

.#{$namespace}field,
%field {
  display: block;
  width: 100%;
  padding: $field-padding;

  color: $field-color;
  font-size: $field-font-size;
  font-family: $field-font-family;
  line-height: $field-line-height;

  border: $field-border;
  background-color: $field-bkg-color;
  border-radius: $field-border-radius;

  // Cleaner font rendering
  // <input> doesn’t inherit from body
  -moz-osx-font-smoothing: grayscale;
   -webkit-font-smoothing: antialiased;

  &:focus {
    border-color: $field-focus-border-color;
    outline: none;
  }

  &[disabled],
  &[readonly] {
    color: $field-disabled-color;
    background-color: $field-disabled-bkg-color;
    cursor: not-allowed;
  }
}

select.#{$namespace}field {
  // Select doesn’t care about vertical padding, we have to set the height instead
  // Calculate the height according to fields configuration
  // Font size * line height + padding + border
  height: floor($field-calc-font-size*$field-line-height + $padding-vertical + $field-border-width*2);
}

textarea.#{$namespace}field {
  resize: vertical;
}

.#{$namespace}checkbox,
%checkbox,
.#{$namespace}radio,
%radio {
  display: inline-block;

  .#{$namespace}label & {
    #{$margin-right}: $spacing-unit-tiny;
  }
}


/**
 * Alternate sizes
 */

.#{$namespace}field--small,
%field--small {
  padding: $field-small-padding;

  font-size: $field-small-font-size;

  border: $field-small-border;
  border-radius: $field-small-border-radius;
}

select.#{$namespace}field--small {
  height: floor($font-size-default * parse-int($field-small-font-size) * $field-line-height + $padding-vertical-small + $field-border-width-small * 2);
  padding-left: $field-small-padding;
  padding-right: $field-small-padding;
}

.#{$namespace}field--large,
%field--large {
  padding: $field-large-padding;

  font-size: $field-large-font-size;

  border: $field-large-border;
  border-radius: $field-large-border-radius;
}

select.#{$namespace}field--large {
  height: floor($font-size-default * parse-int($field-large-font-size) * $field-line-height + $padding-vertical-large + $field-border-width-large * 2);
}


/**
 * Labels<commit_msg>refactor(forms): remove duplicate padding definition<commit_after>/*----------------------------------------*\
  FORMS
\*----------------------------------------*/

// Prepare some required values
// Find the field border "width" from $field-border parameter
$field-border-width: 0;
$field-border-width-small: 0;
$field-border-width-large: 0;

@each $value in $field-border {
  @if type-of($value) == 'number' {
    $field-border-width: $value;
    $field-border-width-small: $value;
    $field-border-width-large: $value;
  }
}
@each $value in $field-small-border {
  @if type-of($value) == 'number' {
    $field-border-width-small: $value;
  }
}
@each $value in $field-large-border {
  @if type-of($value) == 'number' {
    $field-border-width-large: $value;
  }
}

// Determine the amount of vertical padding for further calculation
$padding-vertical: 0;
$padding-vertical-small: 0;
$padding-vertical-large: 0;

$padding-vertical: total-vertical-padding($field-padding);
$padding-vertical-small: total-vertical-padding($field-small-padding);
$padding-vertical-large: total-vertical-padding($field-large-padding);

// In case the fields font-size is a number (ie. not 'inherit'), use it instead of default font-size for calculation
$field-calc-font-size: $font-size-default;

@if (type-of($field-font-size) == 'number') {
  $field-calc-font-size: $field-font-size;
}


/**
 * Fields
 */

.#{$namespace}field,
%field {
  display: block;
  width: 100%;
  padding: $field-padding;

  color: $field-color;
  font-size: $field-font-size;
  font-family: $field-font-family;
  line-height: $field-line-height;

  border: $field-border;
  background-color: $field-bkg-color;
  border-radius: $field-border-radius;

  // Cleaner font rendering
  // <input> doesn’t inherit from body
  -moz-osx-font-smoothing: grayscale;
   -webkit-font-smoothing: antialiased;

  &:focus {
    border-color: $field-focus-border-color;
    outline: none;
  }

  &[disabled],
  &[readonly] {
    color: $field-disabled-color;
    background-color: $field-disabled-bkg-color;
    cursor: not-allowed;
  }
}

select.#{$namespace}field {
  // Select doesn’t care about vertical padding, we have to set the height instead
  // Calculate the height according to fields configuration
  // Font size * line height + padding + border
  height: floor($field-calc-font-size*$field-line-height + $padding-vertical + $field-border-width*2);
}

textarea.#{$namespace}field {
  resize: vertical;
}

.#{$namespace}checkbox,
%checkbox,
.#{$namespace}radio,
%radio {
  display: inline-block;

  .#{$namespace}label & {
    #{$margin-right}: $spacing-unit-tiny;
  }
}


/**
 * Alternate sizes
 */

.#{$namespace}field--small,
%field--small {
  padding: $field-small-padding;

  font-size: $field-small-font-size;

  border: $field-small-border;
  border-radius: $field-small-border-radius;
}

select.#{$namespace}field--small {
  height: floor($font-size-default * parse-int($field-small-font-size) * $field-line-height + $padding-vertical-small + $field-border-width-small * 2);
}

.#{$namespace}field--large,
%field--large {
  padding: $field-large-padding;

  font-size: $field-large-font-size;

  border: $field-large-border;
  border-radius: $field-large-border-radius;
}

select.#{$namespace}field--large {
  height: floor($font-size-default * parse-int($field-large-font-size) * $field-line-height + $padding-vertical-large + $field-border-width-large * 2);
}


/**
 * Labels
{'fraction_non_alphanumeric': 0.1924522845575477, 'fraction_numerical': 0.003470213996529786, 'mean_word_length': 3.4597034171502257, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7633811', 'n_tokens_mistral': 2389, 'n_tokens_neox': 2298, 'n_words': 463}