@use "./../../../styles/tokens/space";
@use "./../../../styles/tokens/breakpoint";
@use "./../../../styles/tools/generate";
@use "./../../../styles/tools/layout";
@use "./config";

@mixin bar-base {
  display: flex;
  margin-bottom: space.get("large");
}

@mixin bar-horizontal() {
  flex-flow: row;
  flex-wrap: wrap;
  align-items: center;
  padding-left: 0;
}

@mixin bar-vertical {
  height: 100%;
  flex-flow: column;
  align-items: stretch;
  margin-top: 0;
}

@mixin bar-item-base() {
  flex: 0 0 auto;
  display: block;
  min-width: 0;
  align-items: center;

  @include layout.reset-last-child-margin-bottom;
}

@mixin bar-item-horizontal {
  margin-bottom: 0;

  &:last-child {
    margin-right: 0;
  }
}

@mixin bar-spacing($direction: "horizontal", $space) {
  @if ($direction == "horizontal") {
    margin-top: -($space);
  }
}

@mixin bar-item-spacing($direction: "horizontal", $space) {
  @if ($direction == "horizontal") {
    margin-top: $space;
    margin-right: $space;
  }

  @if ($direction == "vertical") {
    margin-bottom: $space;
  }
}

@mixin bar-item-vertical {
  margin-top: 0;
  margin-right: 0;
}

@mixin bar-item-fill {
  flex: 1 0 1px;
}

@mixin bar-item-shrinkable {
  flex-shrink: 1;
}

@mixin bar-border() {
  border-left: $border;
  align-self: stretch;
}

@mixin bar-break() {
  flex: 1 0 100%;
}

@mixin bar-nowrap() {
  flex-wrap: nowrap;
}
