p,
.paragraph {
  /* Set base margin-bottom to all basic typo elements */
  margin-bottom: @typography[base-margin];

  &-no-margin {
    margin-bottom: unset;
  }
}

.scale-type(
  @exponent: 0,
  @base: @typography[base-font-size],
  @ratio: @typography[base-type-ratio]
  ) {
  @result: @base * pow(@ratio, @exponent);
}

.add-paragraph(
  @name,
  @exponent: 0,
  @base: @typography[base-font-size],
  @ratio: @typography[base-type-ratio]
  ) {
  .@{name} {
    font-size: .scale-type(
      @exponent,
      @base,
      @ratio
    )[@result];
  }
}

/* Build default paragraphs with the config ruleset @paragraph-sizes */

each(@paragraph-sizes, {
  .add-paragraph(@key, @value);

  @media screen and (max-width: @media[mobile]) {
    .add-paragraph(
      @key,
      @value,
      @typography[base-font-size],
      @typography[mobile-type-ratio]
    );
  }
});

small,
.small {
  font-size: .scale-type(-1)[@result];
  font-weight: normal;
  text-transform: uppercase;
}
