From c1a6a38f6884fbc7c694588566eb5f364bfd82c7 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Sun, 13 Sep 2020 22:03:55 +0100 Subject: [PATCH] Set core focus styles for links - add new focus style to `govuk-link` class - do the same for `govuk-link--destructive` class --- .../stylesheets/govuk-frontend/focus/core.scss | 14 ++++++++++++++ .../govuk-frontend/focus/extensions.scss | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 app/assets/stylesheets/govuk-frontend/focus/core.scss create mode 100644 app/assets/stylesheets/govuk-frontend/focus/extensions.scss diff --git a/app/assets/stylesheets/govuk-frontend/focus/core.scss b/app/assets/stylesheets/govuk-frontend/focus/core.scss new file mode 100644 index 000000000..7e7290bea --- /dev/null +++ b/app/assets/stylesheets/govuk-frontend/focus/core.scss @@ -0,0 +1,14 @@ +// Sass bringing in the new focus style from GOVUK Frontend 3.x.x +// TO DO: Delete this file when we upgrade to GOVUK Frontend 3.x.x +// +// See the following for details of the update: +// - https://designnotes.blog.gov.uk/2019/07/29/weve-made-the-gov-uk-design-system-more-accessible/ +// - https://design-system.service.gov.uk/get-started/focus-states/ +// - https://github.com/alphagov/govuk-frontend/releases/tag/v3.0.0 +// +// These styles were added in https://github.com/alphagov/govuk-frontend/pull/1309 + +// Hack to fix not being able to override the govuk-link-common mixin +.govuk-link { + @include govuk-focusable-text-link; +} diff --git a/app/assets/stylesheets/govuk-frontend/focus/extensions.scss b/app/assets/stylesheets/govuk-frontend/focus/extensions.scss new file mode 100644 index 000000000..dc0ef347c --- /dev/null +++ b/app/assets/stylesheets/govuk-frontend/focus/extensions.scss @@ -0,0 +1,14 @@ +// Sass bringing in the new focus style from GOVUK Frontend 3.x.x +// TO DO: Delete this file when we upgrade to GOVUK Frontend 3.x.x +// +// See the following for details of the update: +// - https://designnotes.blog.gov.uk/2019/07/29/weve-made-the-gov-uk-design-system-more-accessible/ +// - https://design-system.service.gov.uk/get-started/focus-states/ +// - https://github.com/alphagov/govuk-frontend/releases/tag/v3.0.0 +// +// These styles were added in https://github.com/alphagov/govuk-frontend/pull/1309 +// (for the error summary component, which we don't use yet) + +.govuk-link--destructive:focus { + @include govuk-focusable-text-link; +}