Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only add underline to back link when href exists #1620

Merged
merged 2 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

### Fixes
- [Pull request #1620: Only add underline to back link when href exists ](https://github.com/alphagov/govuk-frontend/pull/1620).

## 3.3.0 (Feature release)

### New features
Expand Down
25 changes: 14 additions & 11 deletions src/govuk/components/back-link/_back-link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

// Allow space for the arrow
padding-left: 14px;
}

// Only add a custom underline if the component is linkable
.govuk-back-link[href] {
// Use border-bottom rather than text-decoration so that the arrow is
// underlined as well.
border-bottom: 1px solid govuk-colour("black");
Expand All @@ -30,22 +33,22 @@
&:focus {
border-bottom-color: transparent;
}
}

// Prepend left pointing arrow
&:before {
@include govuk-shape-arrow($direction: left, $base: 10px, $height: 6px);
// Prepend left pointing arrow
.govuk-back-link:before {
@include govuk-shape-arrow($direction: left, $base: 10px, $height: 6px);

content: "";
content: "";

// Vertically align with the parent element
position: absolute;
// Vertically align with the parent element
position: absolute;

top: 0;
bottom: 0;
left: 0;
top: 0;
bottom: 0;
left: 0;

margin: auto;
}
margin: auto;
}

@if $govuk-use-legacy-font {
Expand Down