Skip to content

Get 2nd next #4

@vwasteels

Description

@vwasteels

Hello, I'm wondering if there is a way to get the second next on the list, example :

$scales: (
  small: 14px,
  normal: 18px, 
  large: 22px,
  xlarge: 26px,
  xxlarge: 40px,
);

@include blockContent($baseSize: normal) {
  font-size: map-get($scales, $baseSize);

  h1 {
    font-size: map-get-next($scales, $baseSize);
  }

  h2 {
    font-size: map-get-next($scales, $baseSize, 2); // <-- this one 
  }
}

// USAGE 
.someText {
  @include blockContent(small);
}
.someOtherText {
  @include blockContent(large);
}

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