Sha256: 024495d1b9b11a8cc617dc88d23ae3653504507afdb28845ad2623cfc68a1eb4

Contents?: true

Size: 1.08 KB

Versions: 21

Compression:

Stored size: 1.08 KB

Contents

.anchored-heading {
  $icon-width: 23px;
  $icon-height: 14px;
  $icon-spacing: 3px;

  position: relative;

  &__icon {
    position: absolute;
    width: $icon-width;
    left: -($icon-width + ($icon-spacing * 2));
    padding: 0 $icon-spacing;
    margin-top: -1px;

    opacity: 0;
    display: none;

    text-decoration: none;
    text-indent: -9999em;

    background-image: file-url('anchored-heading-icon.png');
    background-repeat: no-repeat;
    background-position: center center;

    @include device-pixel-ratio {
      background-image: file-url('anchored-heading-icon-2x.png');
      background-size: $icon-width $icon-height;
    }

    @include media(tablet) {
      display: block;
    }

    &:before {
      // zero width space character so that the link behaves like it has text,
      // has height, sits on the baseline, etc.
      content: "\200b";
    }
  }

  &:hover &__icon {
    @include media(tablet) {
      opacity: 1;
    }
  }

  &__icon:focus {
    @include media(tablet) {
      opacity: 1;
      outline-width: 1px;
      padding: 0 ($icon-spacing - 1);
    }
  }
}

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
govuk_tech_docs-1.9.0.pre.rc2 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.9.0.pre.gfe lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.8.3 lib/assets/stylesheets/modules/_anchored-heading.scss
dss_tech_docs-0.1.2 lib/assets/stylesheets/modules/_anchored-heading.scss
dss_tech_docs-0.1.1 lib/assets/stylesheets/modules/_anchored-heading.scss
dss_tech_docs-0.1.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.8.2 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.8.1 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.8.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.7.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.6.3 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.6.2 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.6.1 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.6.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.5.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.4.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.3.1 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.3.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.2.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-1.1.0 lib/assets/stylesheets/modules/_anchored-heading.scss