Skip to content

Commit

Permalink
Move visited modifier so it does not conflict
Browse files Browse the repository at this point in the history
By moving this selector before the original `.govuk-link` selector we can avoid a conflict which stops focused links from having a text colour.
  • Loading branch information
NickColley committed Sep 6, 2018
1 parent 0372f96 commit 841ba1b
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/core/_links.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
@include govuk-exports("govuk/core/links") {

// 'No visited state' link mixin
//
// Used in cases where it is not helpful to distinguish between visited and
// non-visited links.
//
// For example, navigation links to pages with dynamic content like admin
// dashboards. The content on the page is changing all the time, so the fact
// that you’ve visited it before is not important.
//
// This is not abstracted as a mixin because it does not provide states for
// all pseudo-selectors so it does not make sense to use it in composition.
//
// This is required to be before the root selector for specificity reasons.
.govuk-link--no-visited-state {
&:visited {
color: $govuk-link-colour;
}
}

%govuk-link {
@include govuk-link-common;
@include govuk-link-style-default;
Expand All @@ -20,21 +39,4 @@
.govuk-link--text-colour {
@include govuk-link-style-text;
}

// 'No visited state' link mixin
//
// Used in cases where it is not helpful to distinguish between visited and
// non-visited links.
//
// For example, navigation links to pages with dynamic content like admin
// dashboards. The content on the page is changing all the time, so the fact
// that you’ve visited it before is not important.
//
// This is not abstracted as a mixin because it does not provide states for
// all pseudo-selectors so it does not make sense to use it in composition.
.govuk-link--no-visited-state {
&:visited {
color: $govuk-link-colour;
}
}
}

0 comments on commit 841ba1b

Please sign in to comment.