// Lightning Design System 2.8.0
// Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license

@mixin nubbin($position: bottom, $location: "after", $color: $color-background-alt, $size: $square-tooltip-nubbin) {

  &:#{$location} {
    @include square($size);
    position: absolute;
    transform: rotate(45deg);
    content: '';
    background-color: $color;

    @if $position == top {
      left: 50%;
      top: (($size / 2) * -1);
      margin-left: (($size / 2) * -1);
    }

    @else if $position == bottom {
      left: 50%;
      bottom: (($size / 2) * -1);
      margin-left: (($size / 2) * -1);
    }

    @else if $position == left {
      top: 50%;
      left: (($size / 2) * -1);
      margin-top: (($size / 2) * -1);
    }

    @else if $position == right {
      top: 50%;
      right: (($size / 2) * -1);
      margin-top: (($size / 2) * -1);
    }
  }
}

@mixin popover($color: $color-background-alt, $shadow: null) {
  position: relative;
  border-radius: $border-radius-medium;
  width: $size-medium;
  min-height: ($square-tooltip-nubbin * 2);
  z-index: $z-index-dialog;
  background-color: $color;
  display: inline-block;

  @if $shadow != null {
    box-shadow: $shadow;
  }
}
