<commit_before>////
/// @group Typography
////

/// Gets a font family from the `$nice-font-families` map, given a name
/// @param {String} $stack The stack name e.g. sans, serif or mono
/// @since 0.1.0
@function font-family($stack) {
  $result: map-get($nice-font-families, $stack);
  @return unquote($result);
}

/// Gets a numeric scale
/// @param $scale {Integer|Name} The integer ratio or named font-size.
/// @since 0.1.0
@function get-scale-integer($scale) {
  @if map-has-key($named-font-sizes, $scale) {
    @return map-get($named-font-sizes, $scale);
  }
  @elseif is-integer($scale) {
    @return $scale;
  }

  @error '`$scale` must either be an integer or exist as a named font size in `$named-font-sizes`';
}


/// Gets a numeric font size (in px) from a given scale multiplier.
/// Usually not used directly - the font-size or font mixin is usually used instead.
/// @param $scale {Integer|Name} The integer ratio or named font-size.
/// @return {Number} Numeric font size (in px)
/// @example
///   $font-size: get-font-size(2)
/// @example
///   $font-size: get-font-size(h1)
/// @since 0.1.0
@function get-font-size($scale) {
  $scale-integer: get-scale-integer($scale);
  $font-map: map-get($font-sizes, $scale-integer);
  @return map-get($font-map, fs);
}

/// Gets a numeric line height (in px) from a given scale multiplier.
/// Usually not used directly - the font-size or font mixin is usually used instead.
/// @param $scale {Integer|Name} The integer ratio or named font-size.
/// @return {Number} Numeric line-height (in px)
/// @example
///   $line-height: get-line-height(2)
/// @example
///   $line-height: get-line-height(h1)
/// @since 0.1.0
@function get-line-height($scale) {
  $scale-integer: get-scale-integer($scale);
  $font-map: map-get($font-sizes, $scale-integer);
  @return map-get($font-map, lh);
}

/// Applies font size and line-height for the given scale.
/// @param $scale {Integer|Name} The integer ratio or named font-size.
/// @example
///   .test {
///     @include font-size(-2);
///   }
/// @example
///   .test {
///     @include font-size(h1);
///   }
/// @since 0.1.0
@mixin font-size($scale: 0) {
  $font-size: get-font-size($scale);
  $line-height: get-line-height($scale);

  font-size: rem($font-size);
  line-height: rem($line-height);
}

/// Nice font: includes font size, line height, and margins.
/// @param $scale {Integer|Name} The integer ratio or named font-size.
/// @example
///   .test {
///     @include font(3);
///   }
/// @example
///   .test {
///     @include font(h1);
///   }
/// @since 0.1.0
@mixin font($scale) {
  @include font-size($scale);

  $scale-integer: get-scale-integer($scale);
  $font-map: map-get($font-sizes, $scale-integer);

  font-weight: map-get($font-map, fw);
  margin-bottom: rem(map-get($font-map, mb));
  margin-top: rem(map-get($font-map, mt));
}

/// Lead paragraph style
/// @since 0.2.12
@mixin lead {
  @include font(lead);
}
<commit_msg>Add ability to override important for typography helpers<commit_after>////
/// @group Typography
////

/// Gets a font family from the `$nice-font-families` map, given a name
/// @param {String} $stack The stack name e.g. sans, serif or mono
/// @since 0.1.0
@function font-family($stack) {
  $result: map-get($nice-font-families, $stack);
  @return unquote($result);
}

/// Gets a numeric scale
/// @param $scale {Integer|Name} The integer ratio or named font-size.
/// @since 0.1.0
@function get-scale-integer($scale) {
  @if map-has-key($named-font-sizes, $scale) {
    @return map-get($named-font-sizes, $scale);
  }
  @elseif is-integer($scale) {
    @return $scale;
  }

  @error '`$scale` must either be an integer or exist as a named font size in `$named-font-sizes`';
}


/// Gets a numeric font size (in px) from a given scale multiplier.
/// Usually not used directly - the font-size or font mixin is usually used instead.
/// @param $scale {Integer|Name} The integer ratio or named font-size.
/// @return {Number} Numeric font size (in px)
/// @example
///   $font-size: get-font-size(2)
/// @example
///   $font-size: get-font-size(h1)
/// @since 0.1.0
@function get-font-size($scale) {
  $scale-integer: get-scale-integer($scale);
  $font-map: map-get($font-sizes, $scale-integer);
  @return map-get($font-map, fs);
}

/// Gets a numeric line height (in px) from a given scale multiplier.
/// Usually not used directly - the font-size or font mixin is usually used instead.
/// @param $scale {Integer|Name} The integer ratio or named font-size.
/// @return {Number} Numeric line-height (in px)
/// @example
///   $line-height: get-line-height(2)
/// @example
///   $line-height: get-line-height(h1)
/// @since 0.1.0
@function get-line-height($scale) {
  $scale-integer: get-scale-integer($scale);
  $font-map: map-get($font-sizes, $scale-integer);
  @return map-get($font-map, lh);
}

/// Applies font size and line-height for the given scale.
/// @param $scale {Integer|Name} The integer ratio or named font-size.
/// @param $important {Boolean} Whether to add an important declaration to the CSS rules.
/// @example
///   .test {
///     @include font-size(-2);
///   }
/// @example
///   .test {
///     @include font-size(h1, true);
///   }
/// @since 0.1.0
@mixin font-size($scale: 0, $important: false) {
  $font-size: get-font-size($scale);
  $line-height: get-line-height($scale);

  @if $important {
    // sass-lint:disable no-important
    font-size: rem($font-size) !important;
    line-height: rem($line-height) !important;
  }
  @else {
    font-size: rem($font-size);
    line-height: rem($line-height);
  }
}

/// Nice font: includes font size, line height, and margins.
/// @param $scale {Integer|Name} The integer ratio or named font-size.
/// @param $important {Boolean} Whether to add an important declaration to the CSS rules.
/// @example
///   .test {
///     @include font(3);
///   }
/// @example
///   .test {
///     @include font(h1, true);
///   }
/// @since 0.1.0
@mixin font($scale, $important: false) {
  @include font-size($scale, $important);

  $scale-integer: get-scale-integer($scale);
  $font-map: map-get($font-sizes, $scale-integer);

  @if $important {
    // sass-lint:disable no-important
    font-weight: map-get($font-map, fw) !important;
    margin-bottom: rem(map-get($font-map, mb)) !important;
    margin-top: rem(map-get($font-map, mt)) !important;
  }
  @else {
    font-weight: map-get($font-map, fw);
    margin-bottom: rem(map-get($font-map, mb));
    margin-top: rem(map-get($font-map, mt));
  }
}

/// Lead paragraph style
/// @since 0.2.12
@mixin lead {
  @include font(lead);
}

{'fraction_non_alphanumeric': 0.19217944831767203, 'fraction_numerical': 0.009396786905122764, 'mean_word_length': 2.9467703349282295, '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': '2646548', 'n_tokens_mistral': 2329, 'n_tokens_neox': 2286, 'n_words': 644}