// @file
// Generate styles for message color variants.

// Declare a list of message styles that can be overriden.
$message-variants: (status $color-highlight) (success $color-success) (warning $color-warning) (error $color-error) !default;

@mixin message($name, $border) {
  %message-#{$name} {
    border-left-color: $border;
    background: #fff;
  }
}

@mixin messages($variants: $message-variants) {
  %message {
    @include box-sizing(border-box);
    margin: ms(-1) 0;
    padding: ms(0);
    border-width: $base-border-width $base-border-width $base-border-width ms(-3);
    border-style: solid;
    border-color: $color-border;
    @include border-top-right-radius;
    @include border-bottom-right-radius;

    > :first-child {
      margin-top: 0;
    }

    > :last-child {
      margin-bottom: 0;
    }
  }

  @each $variant in $variants {
    $name: nth($variant, 1);
    $border: nth($variant, 2);

    @include message($name, $border);
  }
}
