Fix focus bug in Safari

Most browsers apply the focus style when a link is
clicked but Safari just applies the active style.
This meant our large links, with expanded click
areas, didn't get the focus style themselves but
their psuedo-elements (which create the expanded
click area) did.

This adds the focus styles to the active state of
links with the expanded click area, to ensure all
of their click area gets the focus style.
This commit is contained in:
Tom Byers
2022-01-27 14:56:15 +00:00
parent 5ad8f41123
commit 10ab1dfe72

View File

@@ -108,17 +108,22 @@ a {
}
}
&:active,
&:focus {
&:focus,
&:active {
&,
&::before {
background-color: $govuk-focus-colour;
box-shadow: 0px -2px $govuk-focus-colour, 0px 4px $govuk-focus-text-colour;
}
&,
& + .template-list-item-hint,
.message-type {
color: $govuk-text-colour;
color: $govuk-focus-text-colour;
}
&::before {
box-shadow: 0px -2px $govuk-focus-colour, 0px 4px $govuk-focus-text-colour;
}
}
@@ -177,7 +182,8 @@ a {
background-image: file-url('folder-blue-bold-hover.svg');
}
&:focus {
&:focus,
&:active {
background-image: file-url('folder-black-bold.svg');
}