.govuk-sticky-element {
  @include transition (opacity, .3s, ease);
  opacity: 1;

  &--hidden {
    opacity: 0;
    pointer-events: none;

    @include ie-lte(8) {
      // XXX: Would be nice to `@include .visuallyhidden`.
      position: absolute;
      left: -9999em;
    }
  }

  &--stuck-to-parent {
    bottom: 0;
    position: absolute;
  }

  &--stuck-to-window {
    bottom: 0;
    position: fixed;
  }

  @include media(mobile) {
    position: static;
  }
}

.sticky-element {
  position: absolute;
  bottom: 0;

  &.govuk-sticky-element {
    @include transition (opacity, .3s, ease);
    opacity: 1;

    &--hidden {
      opacity: 0;
      pointer-events: none;

      @include ie-lte(8) {
        // XXX: Would be nice to `@include .visuallyhidden`.
        position: absolute;
        left: -9999em;
      }
    }

    &--stuck-to-parent {
      bottom: 0;
      position: absolute;
    }

    &--stuck-to-window {
      bottom: 0;
      position: fixed;
    }

    @include media(mobile) {
      position: static;
    }
  }
}

Fix for sticky contents link overlap issue
Fix for sticky contents link overlap issue

* At foot of page was possible to get 'Contents' fixed position link to briefly overlap content below it
* Problem was due to height of parent element including height of Contents link, then changing after it was set to position fixed
* Fixed by defaulting Contents link to position absolute so it never adds any height to the parent
