SassDoc / sassdoc

Release the docs!
http://sassdoc.com
MIT License
1.41k stars 56 forks source link

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

Open wawyed opened 11 months ago

wawyed commented 11 months ago

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