// Copied from govuk_elements helpers

// Return ems from a pixel value
// This assumes a base of 19px
@function em($px, $base: 19) {
  @return ($px / $base) + em;
}

// Mixin to clean up retina bg images
@mixin background-image($path, $width, $height, $extension: ".png") {
  background-image: image-url($path + $extension);
  @include device-pixel-ratio() {
    background-image: image-url($path + "-2x" + $extension);
    background-size: $width $height;
  }
}

// Hide, but not for screenreaders
.visuallyhidden {
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  height: 1px;
  width: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
}

// Overrides frontend_toolkit
%outdent-to-full-width {
  margin-left: -$gutter-half;
  margin-right: -$gutter-half;
}
%mobile-outdent {
  @extend %outdent-to-full-width;
  @include media(tablet){
    margin-left: 0;
    margin-right: 0;
  }
}
%mobile-outdent-and-pad {
  @extend %mobile-outdent;
  padding-left: $gutter-half;
  padding-right: $gutter-half;
  @include media(tablet){
    padding-left: 0;
    padding-right: 0;
  }
}
