sassdoc icon indicating copy to clipboard operation
sassdoc copied to clipboard

How to document @function that takes parameter a map key.

Open wawyed opened this issue 9 months ago • 0 comments

For example I'd like to document the following function:

/// Generates a font size
///
/// @param {String} $sizeName
///   The name of the font size
/// @return {number} The value of the font size
@function get-font-size($sizeName) {
  @if map.has-key($scale-exponent-map, $sizeName) {
    $multiplier: math.pow($scale, map.get($scale-exponent-map, $sizeName));

    @return calc(var(--ItgApp-baseFontSize) * #{$multiplier});
  } @else {
    @error "Size #{$sizeName} must one of the following #{map.keys($scale-exponent-map)}";
  }
}

I'd like $sizeName type to be something like a key of $scale-exponent-map

wawyed avatar Sep 21 '23 12:09 wawyed