<commit_before>/**
 * Theme any css property based on the current palette, accepting a themable
 * value that will give an contrasted
 * ---
 * Usage example:
 *
 * .md-foo {
 *   min-width: 88px;
 *   height: 40px;
 *   background: md-theme(primary);
 * }
 *
 * ---
 * @access public
 * ---
 * @param {string} $type —  The themable value
 */

@function md-theme($type, $background: "") {
  $color-theme: null;

  @if $type == 'primary' or $type == 'accent' {
    @return get-color-by-type($type);
  } @else {
    @if $background == "" {
      $color-theme: map-get($md-theme-palette, theme);
    } @else {
      $color-theme: md-pick-contrast(get-color-by-type($background));
    }

    @return get-color-by-theme($color-theme, $type);
  }
}


/**
 * Get a color based on type by theme
 * ---
 * Usage example:
 *
 * $color: get-color-by-theme(dark, primary)
 *
 * ---
 * @access public
 * ---
 * @param {string} $color-theme —  The theme color | Accepts dark or light
 * @param {string} $type —  The color type
 */

@function get-color-by-theme($color-theme, $type) {
  $theme: map-get($md-color-levels, $color-theme);

  @return map-get($theme, $type);
}


/**
 * Get a color based on type only
 * ---
 * Usage example:
 *
 * $color: get-color-by-type(accent)
 *
 * ---
 * @access public
 * ---
 * @param {string} $type —  The color type
 */

@function get-color-by-type($type) {
  @return map-get($md-theme-palette, $type);
}
<commit_msg>prefix functions with md-<commit_after>/**
 * Theme any css property based on the current palette, accepting a themable
 * value that will give an contrasted
 * ---
 * Usage example:
 *
 * .md-foo {
 *   min-width: 88px;
 *   height: 40px;
 *   background: md-theme(primary);
 * }
 *
 * ---
 * @access public
 * ---
 * @param {string} $type —  The themable value
 */

@function md-theme($type, $background: "") {
  $color-theme: null;

  @if $type == 'primary' or $type == 'accent' {
    @return md-get-color-by-type($type);
  } @else {
    @if $background == "" {
      $color-theme: map-get($md-theme-palette, theme);
    } @else {
      $color-theme: md-pick-contrast(md-get-color-by-type($background));
    }

    @return md-get-color-by-theme($color-theme, $type);
  }
}


/**
 * Get a color based on type by theme
 * ---
 * Usage example:
 *
 * $color: md-get-color-by-theme(dark, primary)
 *
 * ---
 * @access public
 * ---
 * @param {string} $color-theme —  The theme color | Accepts dark or light
 * @param {string} $type —  The color type
 */

@function md-get-color-by-theme($color-theme, $type) {
  $theme: map-get($md-color-levels, $color-theme);

  @return map-get($theme, $type);
}


/**
 * Get a color based on type only
 * ---
 * Usage example:
 *
 * $color: md-get-color-by-type(accent)
 *
 * ---
 * @access public
 * ---
 * @param {string} $type —  The color type
 */

@function md-get-color-by-type($type) {
  @return map-get($md-theme-palette, $type);
}

{'fraction_non_alphanumeric': 0.19266369557764826, 'fraction_numerical': 0.002742543709290367, 'mean_word_length': 2.741025641025641, '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': '6506153', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1036, 'n_words': 261}