/// Never do `@media(min-width: xxx)` again, do it in a sensible way.
/// **This requires the breakpoints map on the settings** you can add remove and rename your breakpoints at will. BYOB (Bring your own Breakpoints)
/// @group layout
/// @parameter {string} $breakpoint - A valid breakpoint from the `$breakpoints` map
/// @parameter {boolean} $max-width - Use true for desktop-first layouts
///
/// @example scss Input
///   .mobile-first {
///     font-size: 1em;
///
///     @include breakpoint(laptop) {
///       font-size: 2em;
///     }
///
///     @include breakpoint(desktop) {
///       font-size: 3em;
///     }
///
///     @include breakpoint(desktop, true) {
///       font-size: 5em;
///     }
///   }
///
/// @example css Output
///   .mobile-first {
///     font-size: 1em; }
///     @media (min-width: 992px) {
///       .mobile-first {
///         font-size: 2em; } }
///     @media (min-width: 1200px) {
///       .mobile-first {
///         font-size: 3em; } }
///     @media (max-width: 1200px) {
///       .mobile-first {
///         font-size: 5em; } }

@mixin breakpoint($breakpoint, $max-width: false) {
  $value: map-get($breakpoints, $breakpoint);

  @if $value != null {
    @if $max-width == false {
      @media (min-width: $value) {
        @content;
      }
    } @else {
      @media (max-width: $value) {
        @content;
      }
    }
  }
  @else {
    @error "Sadly #{$breakpoint} does not exist 😩 please check Manila's _settings.scss to know which you can use";
  }
}
