Sha256: 34b2e175cc40d3024b4c7ffa15d1cc6374d44a2af1176447a8d47be62974398d

Contents?: true

Size: 1.13 KB

Versions: 30

Compression:

Stored size: 1.13 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: url('/images/anchored-heading-icon.png');
    background-repeat: no-repeat;
    background-position: center center;

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

    @include govuk-media-query(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 govuk-media-query(tablet) {
      opacity: 1;
    }
  }

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

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
govuk_tech_docs-3.1.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-3.0.1 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-3.0.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.4.3 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.4.2 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.4.1 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.4.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.3.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.2.2 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.2.1 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.2.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.1.1 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.1.0 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.0.13 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.0.12 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.0.11 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.0.10 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.0.9 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.0.8 lib/assets/stylesheets/modules/_anchored-heading.scss
govuk_tech_docs-2.0.7 lib/assets/stylesheets/modules/_anchored-heading.scss