11@use " nhsuk-frontend/dist/nhsuk/core/settings" as * ;
22@use " nhsuk-frontend/dist/nhsuk/core/tools" as * ;
3-
4- $govuk-spacing1 : 5px ;
5- $govuk-spacing2 : 10px ;
6- $govuk-spacing3 : 15px ;
7- $govuk-spacing4 : 20px ;
3+ @use " nhsuk-frontend/dist/nhsuk/core/helpers" as * ;
84
95.app-secondary-navigation {
10- @include nhsuk-responsive-margin ( 4 , " bottom " ) ;
11- }
6+ margin-right : #{ $ nhsuk-gutter-half * -1 } ;
7+ margin-left : #{ $nhsuk-gutter-half * -1 } ;
128
13- .app-secondary-navigation__list-item {
14- margin : 0 ;
15- }
9+ @include nhsuk-responsive-margin (5 , " bottom" );
1610
17- .app-secondary-navigation__list-item--current {
18- border-bottom-width : $govuk-spacing1 ;
11+ @include nhsuk-media-query ($from : tablet) {
12+ margin-right : auto ;
13+ margin-left : auto ;
14+ }
1915}
2016
2117.app-secondary-navigation__link {
22- padding-left : $govuk-spacing3 ;
23- padding-right : $govuk-spacing3 ;
24- }
25-
26- // --------
18+ display : flex ;
19+ align-items : center ;
20+ gap : 6px ;
21+ padding : nhsuk-spacing (2 ) $nhsuk-gutter-half ;
2722
28- .app-secondary-navigation {
29- @include nhsuk-font ( $size : 19 ) ;
30- }
23+ & :link {
24+ text-decoration : none ;
25+ }
3126
32- .app-secondary-navigation__link {
3327 @include nhsuk-link-style-default ;
3428 @include nhsuk-link-style-no-visited-state ;
3529
36- & :link {
30+ @include nhsuk-media-query ($from : tablet) {
31+ padding : nhsuk-spacing (3 ) 2px ;
32+ }
33+
34+ & [aria-current ] {
35+ color : $nhsuk-text-colour ;
36+ box-shadow : inset $nhsuk-border-width 0 nhsuk-colour (" blue" );
3737 text-decoration : none ;
38+
39+ @include nhsuk-media-query ($from : tablet) {
40+ box-shadow : inset 0 ($nhsuk-border-width * -1 ) nhsuk-colour (" blue" );
41+ }
3842 }
3943
40- // Extend the touch area of the link to the list
41- & ::after {
42- bottom : 0 ;
43- content : " " ;
44- left : 0 ;
45- position : absolute ;
46- right : 0 ;
47- top : 0 ;
44+ & :focus {
45+ box-shadow : inset $nhsuk-focus-width 0 $nhsuk-focus-text-colour ;
46+
47+ @include nhsuk-media-query ($from : tablet) {
48+ box-shadow : inset 0 ($nhsuk-focus-width * -1 ) $nhsuk-focus-text-colour ;
49+ }
50+ }
51+
52+ .nhsuk-icon {
53+ width : 1.5rem ;
54+ height : 1.5rem ;
4855 }
4956}
5057
@@ -60,52 +67,32 @@ $govuk-spacing4: 20px;
6067 }
6168}
6269
70+ .app-secondary-navigation__current {
71+ font-weight : inherit ;
72+ }
73+
6374.app-secondary-navigation__list {
64- @include nhsuk-clearfix ;
75+ display : flex ;
6576
66- // The list uses box-shadow rather than a border to set a 1px
67- // grey line at the bottom, so that border from the current
68- // item appears on top of the grey line.
69- box-shadow : inset 0 -1px 0 $nhsuk-border-colour ;
70- list-style : none ;
77+ flex-flow : column ;
78+
79+ width : 100% ;
7180 margin : 0 ;
7281 padding : 0 ;
73- width : 100% ;
74- }
75-
76- .app-secondary-navigation__list-item {
77- box-sizing : border-box ;
78- display : block ;
79- float : left ;
80- margin-right : $govuk-spacing4 ;
81- padding-bottom : $govuk-spacing2 ;
82- padding-top : $govuk-spacing2 ;
83- position : relative ;
84-
85- // More generous padding beneath items on wider screens
86- @include nhsuk-media-query ($from : tablet) {
87- padding-bottom : $govuk-spacing3 ;
88- }
89- }
9082
91- // The last item of the list doesn’t need any spacing to its right.
92- // Removing this prevents the item from wrapping to the next line
93- // unnecessarily.
94- .app-secondary-navigation__list-item :last-child {
95- margin-right : 0 ;
96- }
83+ list-style : none ;
84+ // The list uses box-shadow rather than a border to set a 1px grey line at the
85+ // bottom, so that the current item appears on top of the grey line.
86+ box-shadow : inset 0 -1px 0 $nhsuk-border-colour ;
9787
98- .app-secondary-navigation__list-item--current {
99- border-bottom : $nhsuk-border-width solid $nhsuk-brand-colour ;
100- padding-bottom : $govuk-spacing1 ;
88+ @include nhsuk-font (19 );
10189
102- // More generous padding beneath items on wider screens
10390 @include nhsuk-media-query ($from : tablet) {
104- padding-bottom : $govuk-spacing2 ;
91+ flex-flow : row wrap ;
92+ gap : nhsuk-spacing (2 ) nhsuk-spacing (5 );
10593 }
10694}
10795
108- .app-secondary-navigation__list-item--current .app-secondary-navigation__link :link ,
109- .app-secondary-navigation__list-item--current .app-secondary-navigation__link :visited {
110- color : $nhsuk-text-colour ;
96+ .app-secondary-navigation__list-item {
97+ margin-bottom : 0 ;
11198}
0 commit comments