Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
wawyed opened this issue Sep 21, 2023 · 0 comments
Open

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

wawyed opened this issue Sep 21, 2023 · 0 comments

Comments

@wawyed
Copy link

wawyed commented Sep 21, 2023

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

1 participant