// TODO: Document these mixins

@mixin anthology-breakpoint($point)
{
  @if A(map-has-key, $_anthology-config-breakpoints, $point)
  {
    $size: A(map-get, $_anthology-config-breakpoints, $point);
    @media (min-width: $size) { @content; }
  }

  @else
  {
    @error '[anthology::breakpoint] --- Breakpoint `#{$point}` is not registered by `A(configure, ...)`. Please register all breakpoints before using `A(breakpoint, ...)`.';
  }
}

@mixin anthology-until-breakpoint($point)
{
  @if A(map-has-key, $_anthology-config-breakpoints, $point)
  {
    $size: A(map-get, $_anthology-config-breakpoints, $point);
    @media (max-width: $size) { @content; }
  }

  @else
  {
    @error '[anthology::until-breakpoint] --- Breakpoint `#{$point}` is not registered by `A(configure, ...)`. Please register all breakpoints before using `A(until-breakpoint, ...)`.';
  }
}

@mixin anthology-between-breakpoints($min-point, $max-point)
{
  $min-size: A(map-get, $_anthology-config-breakpoints, $min-point);
  $max-size: A(map-get, $_anthology-config-breakpoints, $max-point);
  @media (min-width: $min-size) and (max-width: $max-size) { @content; }
}
