<commit_before>@require 'vars';
@require 'prefixes';

/*
    Provides man mixins for use within the MDN theme.
*/

/* searches expression for the provided string and replaces with provided value */
replace($expr, $str, $val) {
  $expr = clone($expr);
  for $e, $i in $expr {
    if ($e == $str) {
      $expr[$i] = $val;
    }
  }
  return $expr;
}


set-font-size(value) {
    font-size: value;

    if (value is not inherit) {

        // make sure we're working with px otherwise remify will just spit out what we spat out before */
        u = unit(value);
        if (u is 'px') {
            font-size: remify(value);
        }
    }
}

remify(value) {
    u = unit(value);

    if (u is 'px') {
        return unit(value/$base-font-size, 'rem')
    } else {
        return unit(value, u)
    }
}

set-smaller-font-size() {
    set-font-size($smaller-font-size);
}
set-larger-font-size() {
    set-font-size($base-bump-font-size);
}<commit_msg>fix bug 1205750 - Limit precision of REM units<commit_after>@require 'vars';
@require 'prefixes';

/*
    Provides man mixins for use within the MDN theme.
*/

/* searches expression for the provided string and replaces with provided value */
replace($expr, $str, $val) {
  $expr = clone($expr);
  for $e, $i in $expr {
    if ($e == $str) {
      $expr[$i] = $val;
    }
  }
  return $expr;
}


set-font-size(value) {
    font-size: value;

    if (value is not inherit) {

        // make sure we're working with px otherwise remify will just spit out what we spat out before */
        u = unit(value);
        if (u is 'px') {
            font-size: remify(value);
        }
    }
}

remify(value) {
    u = unit(value);
    v = 0;

    if (u is 'px') {
        v = unit(value/$base-font-size, 'rem')
    } else {
        v = unit(value, u)
    }

    return round(v, 3);
}

set-smaller-font-size() {
    set-font-size($smaller-font-size);
}
set-larger-font-size() {
    set-font-size($base-bump-font-size);
}
{'fraction_non_alphanumeric': 0.15741212429954152, 'fraction_numerical': 0.004584819154355578, 'mean_word_length': 2.289782244556114, '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': '5304198', 'n_tokens_mistral': 716, 'n_tokens_neox': 692, 'n_words': 196}