<commit_before>////
/// @group helpers
////

/// A map of glyph name to code point (character entity reference).
/// Avoids magic strings like `content: '\201C'` within our SASS.
/// Usual usage is via the `get-glyph` function, e.g. `get-glyph(greater-than)`.
/// @see get-glyph
/// @link https://css-tricks.com/snippets/html/glyphs/
/// @prop {String} bullet [2022] Bullet (•)
/// @prop {String} copyright [00a9] Copyright symbol (©)
/// @prop {String} greater-than [003e] Greater than symbol (>)
/// @prop {String} left-double-quotation-mark [201C] Left double quotation mark (“)
/// @prop {String} less-than [003c] Less than symbol (<)
/// @prop {String} punc-space [02008] Punctuation space (small, width of a comma)
/// @since 0.1.0
$nice-glyphs: (
  bullet: '2022',
  copyright: '00a9',
  greater-than: '003e',
  left-double-quotation-mark: '201C',
  less-than: '003c',
  punc-space: '02008'
  // Add more entity codes here as and when they're needed
) !default;

/// Gets a glyph code, or several, (character entity reference) from the
/// `$nice-glyphs` map, matching the given `$names`. Usually used with the content
/// property for psuedo elements, to avoid use of magic character reference strings.
/// @param {argList} $names The name(s) of the glyph(s) to get
/// @returns {string} The character entity reference code(s) as a string, e.g. '\201C' or '\02008\029C9'
/// @see $nice-glyphs
/// @since 0.1.0
/// @example Single glyph
///   .rule {
///     content: get-glyph(greater-than);
///   }
/// @example Multiple glyphs together
///   .rule {
///     content: get-glyph(punc-space, box-box);
///   }
@function get-glyph($names...) {
  $codes: '';

  @each $name in $names {
    @if map-has-key($nice-glyphs, $name) {
      $code: map-get($nice-glyphs, $name);
      $codes: $codes + '\\#{$code}';
    } @else {
      @error 'Glyph with name #{$name} could not be found in the $nice-glyphs map';
    }
  }

  @return unquote('\'#{$codes}\'');
}

@if $nice-output-glyph-classes {
  /// Output a BEM style glyph selector for each glyph in the map.
  /// E.g. .glyph.glyph--bullet { content: '\2022'; }
  /// @since 0.1.0
  .glyph {
    @each $key, $value in $nice-glyphs {
      &--#{$key} {
        &::before {
          content: unquote('\'\\#{$value}\'');
        }
      }
    }
  }
}
<commit_msg>Add new glyphs<commit_after>////
/// @group helpers
////

/// A map of glyph name to code point (character entity reference).
/// Avoids magic strings like `content: '\201C'` within our SASS.
/// Usual usage is via the `get-glyph` function, e.g. `get-glyph(greater-than)`.
/// @see get-glyph
/// @link https://css-tricks.com/snippets/html/glyphs/
/// @prop {String} bullet [2022] Bullet (•)
/// @prop {String} copyright [00a9] Copyright symbol (©)
/// @prop {String} greater-than [003e] Greater than symbol (>)
/// @prop {String} hyphen-minus [002d] Hyphen minus (-)
/// @prop {String} left-double-quotation-mark [201C] Left double quotation mark (“)
/// @prop {String} less-than [003c] Less than symbol (<)
/// @prop {String} plus [002b] Plus sign (+)
/// @prop {String} punc-space [02008] Punctuation space (small, width of a comma)
/// @since 0.1.0
$nice-glyphs: (
  bullet: '2022',
  copyright: '00a9',
  greater-than: '003e',
  hyphen-minus: '002d',
  left-double-quotation-mark: '201C',
  less-than: '003c',
  plus: '002b',
  punc-space: '02008'
  // Add more entity codes here as and when they're needed
) !default;

/// Gets a glyph code, or several, (character entity reference) from the
/// `$nice-glyphs` map, matching the given `$names`. Usually used with the content
/// property for psuedo elements, to avoid use of magic character reference strings.
/// @param {argList} $names The name(s) of the glyph(s) to get
/// @returns {string} The character entity reference code(s) as a string, e.g. '\201C' or '\02008\029C9'
/// @see $nice-glyphs
/// @since 0.1.0
/// @example Single glyph
///   .rule {
///     content: get-glyph(greater-than);
///   }
/// @example Multiple glyphs together
///   .rule {
///     content: get-glyph(punc-space, box-box);
///   }
@function get-glyph($names...) {
  $codes: '';

  @each $name in $names {
    @if map-has-key($nice-glyphs, $name) {
      $code: map-get($nice-glyphs, $name);
      $codes: $codes + '\\#{$code}';
    } @else {
      @error 'Glyph with name #{$name} could not be found in the $nice-glyphs map';
    }
  }

  @return unquote('\'#{$codes}\'');
}

@if $nice-output-glyph-classes {
  /// Output a BEM style glyph selector for each glyph in the map.
  /// E.g. .glyph.glyph--bullet { content: '\2022'; }
  /// @since 0.1.0
  .glyph {
    @each $key, $value in $nice-glyphs {
      &--#{$key} {
        &::before {
          content: unquote('\'\\#{$value}\'');
        }
      }
    }
  }
}

{'fraction_non_alphanumeric': 0.1944677284157586, 'fraction_numerical': 0.03185247275775356, 'mean_word_length': 2.6942724458204332, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6531119', 'n_tokens_mistral': 1804, 'n_tokens_neox': 1633, 'n_words': 510}