From e0e8500daf25bc9829c2608fd1f70c60c24ffdda Mon Sep 17 00:00:00 2001 From: Nick Colley Date: Tue, 10 Sep 2019 10:47:25 +0100 Subject: [PATCH 1/2] Ensure legacy styles do not override button active state Add additional selector only when GOV.UK Template is loaded to ensure it does not override GOV.UK Frontend's active state. This was missed because the links are all visited which gives the selectors a higher specificity. --- src/govuk/components/button/_button.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/govuk/components/button/_button.scss b/src/govuk/components/button/_button.scss index fe9b1af20a..f2de6f65d4 100644 --- a/src/govuk/components/button/_button.scss +++ b/src/govuk/components/button/_button.scss @@ -98,6 +98,17 @@ box-shadow: inset 0 0 0 1px $govuk-focus-colour; } + // alphagov/govuk_template includes a specific a:link:focus selector + // designed to make unvisited links 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-button-text-colour; + } + } + &:focus:not(:active):not(:hover) { border-color: $govuk-focus-colour; color: $govuk-focus-text-colour; From 9e84713087d7480f6680c435ea5df1c5eecd9e1e Mon Sep 17 00:00:00 2001 From: Nick Colley Date: Tue, 10 Sep 2019 12:15:59 +0100 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff666b7d6a..fffd0c880a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,13 @@ #### Add formGroup parameter to character count component -- [Pull request #1553: Include formGroup on character count and pass through to textarea to allow class to be added to character count form group](https://github.com/alphagov/govuk-frontend/pull/1553) +- [Pull request #1553: Include formGroup on character count and pass through to textarea to allow class to be added to character count form group](https://github.com/alphagov/govuk-frontend/pull/1553). ### Fixes - [Pull request #1548: Fix fieldset legend text clipping when using a custom or fallback font](https://github.com/alphagov/govuk-frontend/pull/1548). - [Pull request #1559: Stop IE8 from downloading GDS Transport font](https://github.com/alphagov/govuk-frontend/pull/1559). +- [Pull request #1564: Ensure legacy styles do not override button active state](https://github.com/alphagov/govuk-frontend/pull/1564). ## 3.1.0 (Feature release)