//
// Positioning
// Inspired by Bootstrap v4
// https://github.com/twbs/bootstrap/blob/v4.3.1/scss/utilities/_position.scss
// --------------------------------------------------

.responsive-positioning(@infix) {
  @media (min-width: ~"@{screen-@{infix}-min}") {
    .position-@{infix}-static   { .position-static; }
    .position-@{infix}-relative { .position-relative; }
    .position-@{infix}-absolute { .position-absolute; }
    .position-@{infix}-fixed    { .position-fixed; }
    .position-@{infix}-sticky   { .position-sticky; }
    .fixed-@{infix}-top         { .fixed-top; }
    .fixed-@{infix}-bottom      { .fixed-bottom; }
    .sticky-@{infix}-top        { .sticky-top; }
  }
}

// Common values

.position-static {
  position: static !important;
}
.pos-rel, // to be depricated in favour of BS4 longhand
.position-relative {
  position: relative !important;
}
.pos-abs, // to be depricated in favour of BS4 longhand
.position-absolute {
  position: absolute !important;
}

.top-0 {
  top: 0;
}
.bottom-0 {
  bottom: 0;
}
.left-0 {
  left: 0;
}
.right-0 {
  right: 0;
}

.pos-fix, // to be depricated in favour of BS4 longhand
.position-fixed {
  position: fixed !important;
}
.pos-sticky, // to be depricated in favour of BS4 longhand
.position-sticky {
  position: sticky !important;
}


// Shorthand

.fixed-top {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: @zindex-fixed;
}
.fixed-bottom {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: @zindex-fixed;
}
.sticky-top {
  @supports (position: sticky) {
    position: sticky;
    top: 0;
    z-index: @zindex-sticky;
  }
}

.responsive-positioning(sm);
.responsive-positioning(md);
.responsive-positioning(lg);
