// @scrollbar($overflow:auto;direction:null;size:null)

// $overflow - sets overflow behavior
// $direction - direction of the scroll 'both', 'x', 'y'
// $size - 'm' = default / 's' = small

@mixin scrollbar($overflow: auto, $direction: null, $size: null) {
  // enable smooth scroll on iOS devices
  -webkit-overflow-scrolling: touch;
  // set desired direction if provided
  @if ($direction) {
    @if ($direction == 'x') {
      overflow-x: $overflow;
    } @else if ($direction == 'y') {
      overflow-y: $overflow;
    }
  }
  // if direction is not set
  @else {
    overflow: $overflow;
  }
  // small scrollbar
  @if ($size == 's') {
    // webkit specific styling
    &::-webkit-scrollbar {
      border-radius: $border-radius--s;
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: $color--grey;
      border-radius: $border-radius--s;
    }
  }
}
