Skip to content

Commit

Permalink
Fixes govuk-elements focussed link colour overriding govuk-frontends
Browse files Browse the repository at this point in the history
govuk-elements uses specific css selector`a:link:focus` whereas
govuk-frontend uses `.govuk-link:focus`. This fix makes govuk-frontend
selector more specific `.govuk-link:link:focus` but only when compatibility
mode is being used.

Co-authored-by: Nick Colley <nick.colley@digital.cabinet-office.gov.uk>
  • Loading branch information
aliuk2012 and NickColley committed May 2, 2019
1 parent 3779e45 commit c1145b9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@

([PR #1287](https://github.com/alphagov/govuk-frontend/pull/1287))

- Fixes govuk-template focussed link colour overriding govuk-frontends

govuk-template uses specific css selector`a:link:focus` whereas
govuk-frontend uses `.govuk-link:focus`. This fix makes govuk-frontend
selector more specific `.govuk-link:link:focus` but only when compatibility
mode is being used.

([PR #1310](https://github.com/alphagov/govuk-frontend/pull/1310))

[compatibility mode]: https://github.com/alphagov/govuk-frontend/blob/master/docs/installation/installing-with-npm.md#compatibility-mode

## 2.11.0 (Feature release)
Expand Down
11 changes: 11 additions & 0 deletions src/helpers/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@
&:focus {
color: $govuk-focus-text-colour;
}

// alphagov/govuk_template includes a specific a:link:focus selector
// designed to make unvisited link s a slightly darker blue when focussed, so
// we need to override the text colour for that combination of selectors so
// so that unvisited links styled as buttons do not end up with dark blue
// text when focussed.
@include govuk-compatibility(govuk_template) {
&:link:focus {
color: $govuk-focus-text-colour;
}
}
}

/// Muted style link mixin
Expand Down

0 comments on commit c1145b9

Please sign in to comment.