Skip to content

Commit

Permalink
fix(primary-navigation): enhance hover styles fo primary navigation l…
Browse files Browse the repository at this point in the history
…inks

Use the standard GDS link hover colour to ensure links colour contrast is sufficient for
readability.

Fixes #447
  • Loading branch information
gregtyler committed Dec 15, 2023
1 parent ef965ef commit 7890c8b
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions src/moj/components/primary-navigation/_primary-navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
text-align: justify; // Trick to remove the need for floats

&:after {
content: '';
content: "";
display: inline-block;
width: 100%;
}

}

.moj-primary-navigation__nav {
Expand All @@ -25,7 +24,6 @@
display: inline-block;
vertical-align: middle;
}

}

.moj-primary-navigation__list {
Expand All @@ -44,7 +42,6 @@
&:last-child {
margin-right: 0;
}

}

.moj-primary-navigation__link {
Expand All @@ -62,11 +59,13 @@
}

&:hover {
color: govuk-tint($govuk-link-colour, 25);
color: #102f74;
}

&:focus {
color: govuk-colour("black"); // Focus colour on yellow should really be black.
color: govuk-colour(
"black"
); // Focus colour on yellow should really be black.
position: relative; // Ensure focus sits above everything else.
z-index: 1;
box-shadow: none;
Expand All @@ -77,7 +76,9 @@
content: "";
display: block;
height: 5px;
position: absolute; bottom: 0; left: 0;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
}

Expand All @@ -91,30 +92,37 @@
content: "";
display: block;
height: 5px;
position: absolute; bottom: 0; left: 0;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
}

&:hover {
color: $govuk-link-hover-colour ;

&:before {
background-color: $govuk-link-hover-colour ;
}
}

&:focus {
color: govuk-colour("black"); // Focus colour on yellow should really be black.
color: govuk-colour(
"black"
); // Focus colour on yellow should really be black.
position: relative; // Ensure focus sits above everything else.
border: none;

&:before {
background-color: govuk-colour("black");
}

}

}

}

.moj-primary-navigation__search {

@include govuk-media-query($from: desktop) {
display: inline-block;
vertical-align: middle;
}

}

0 comments on commit 7890c8b

Please sign in to comment.