/**
 * Hide visually
 *
 * See http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 * for discussion of different solutions
 */

@mixin visuallyhidden() {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}
@mixin visuallyhiddenReset() {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}
@mixin visuallyhiddenFocusable() {
  @include visuallyhidden;

  &:focus,
  &:active {
    @include visuallyhiddenReset;
  }
}


/**
 * Contain floats with clearfix
 *
 * http://nicolasgallagher.com/micro-clearfix-hack/
 */

@mixin clearfix() {
  *zoom: 1;

  &:before,
  &:after {
    content: " ";
    display: table;
  }

  &:after {
    clear: both;
  }
}


/**
 * Lists with layout purpose
 */

@mixin resetList() {
  list-style: none;
  margin: 0;
  padding: 0;
}


/**
 * Replace text
 */

@mixin replaceText() {
  display: block;
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
}


/**
 * Better font rendering (on OS X)
 * http://maximilianhoffmann.com/posts/better-font-rendering-on-osx
 *
 * Usage:
 *
 * .xy--dark-on-light {
 * 	@include fontSmoothing;
 * }
 * .xy--light-on-dark {
 * 	@include fontSmoothingReset;
 * }
 */

@mixin fontSmoothing() {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@mixin fontSmoothingReset() {
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
}


/**
 * Placeholder in input fields
 */

@mixin placeholder() {

  &::-webkit-input-placeholder {
    @content;
  }

  &:-moz-placeholder { // Firefox 18-
    @content;
  }

  &::-moz-placeholder { // Firefox 19+
    @content;
  }

  &:-ms-input-placeholder {
    @content;
  }
}
