//
// Themes mixins
// -----------------------------------------

@mixin themes($property, $variable-name, $important: false) {
  @each $theme, $map in $themes {
    .#{$theme} & {
      @if ($important == false) {
        #{$property}: map-get($map, $variable-name);
      } @else {
        #{$property}: map-get($map, $variable-name) !important;
      }
    }
  }
}

@mixin themes-value($property, $value, $important: false) {
  @each $theme, $map in $themes {
    .#{$theme} & {
      @if ($important == false) {
        #{$property}: $value;
      } @else {
        #{$property}: $value !important;
      }
    }
  }
}

@mixin themes-border(
  $variable-name,
  $width: 1px,
  $style: solid,
  $important: false
) {
  border-width: $width;
  border-style: solid;

  @include themes(border-color, $variable-name, $important);
}

@mixin themes-border-top(
  $variable-name,
  $width: 1px,
  $style: solid,
  $important: false
) {
  border-top-width: $width;
  border-top-style: solid;

  @include themes(border-top-color, $variable-name, $important);
}

@mixin themes-border-bottom(
  $variable-name,
  $width: 1px,
  $style: solid,
  $important: false
) {
  border-bottom-width: $width;
  border-bottom-style: solid;

  @include themes(border-bottom-color, $variable-name, $important);
}

@mixin themes-border-right(
  $variable-name,
  $width: 1px,
  $style: solid,
  $important: false
) {
  border-right-width: $width;
  border-right-style: solid;

  @include themes(border-right-color, $variable-name, $important);
}

@mixin themes-border-left(
  $variable-name,
  $width: 1px,
  $style: solid,
  $important: false
) {
  border-left-width: $width;
  border-left-style: solid;

  @include themes(border-left-color, $variable-name, $important);
}
