Skip to content

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

@wawyed

Description

@wawyed

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions