// Clearfix
//
// For modern browsers
// 1. The space content is one way to avoid an Opera bug when the
//    contenteditable attribute is included anywhere else in the document.
//    Otherwise it causes space to appear at the top and bottom of elements
//    that are clearfixed.
// 2. The use of `table` rather than `block` is only necessary if using
//    `:before` to contain the top-margins of child elements.
//
// Source: http://nicolasgallagher.com/micro-clearfix-hack/

@mixin clearfix() {
  &:before,
  &:after {
    content: " "; // 1
    display: table; // 2
  }
  &:after {
    clear: both;
  }
}

// Center-align a block level element
@mixin center-block() {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

// CSS3 Content Columns
@mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
  -webkit-column-count: $column-count;
     -moz-column-count: $column-count;
          column-count: $column-count;
  -webkit-column-gap: $column-gap;
     -moz-column-gap: $column-gap;
          column-gap: $column-gap;
}


// Positioning
//--------------

@mixin position-relative() {
  position: relative !important;
}

@mixin position-fixed() {
  position: fixed;
  top: 0;
  left:  0;
  right:  0;
}

@mixin position-absolute($top, $left, $right, $bottom) {
  position: absolute;
  top: $top;
  left: $left;
  right: $right;
  bottom: $bottom;
}

@mixin position-fill() {
  @include position-absolute(0, 0, 0, 0)
}

@mixin position-top() {
  @include position-absolute(0, 0, 0, none)
}

@mixin position-bottom() {
    position: absolute;
    bottom: 0;
    left:  0;
    right:  0;
}
