File tree Expand file tree Collapse file tree 6 files changed +39
-8
lines changed Expand file tree Collapse file tree 6 files changed +39
-8
lines changed Original file line number Diff line number Diff line change @@ -167,3 +167,20 @@ exports.getMacroOptions = getMacroOptions
167
167
* @property {string } href - The URL of the ancestor page
168
168
* @property {string } text - The title of the ancestor page
169
169
*/
170
+
171
+ /**
172
+ * Helper function that returns true if the current page is the homepage, useful
173
+ * for outputting things conditionally.
174
+ *
175
+ * @returns {boolean } If this is the homepage or not
176
+ */
177
+
178
+ exports . isHomepage = function ( ) {
179
+ const permalink = this . lookup ( 'permalink' )
180
+
181
+ // The homepage always has an empty string as a permalink
182
+ if ( typeof permalink === 'string' && permalink === '' ) {
183
+ return true
184
+ }
185
+ return false
186
+ }
Original file line number Diff line number Diff line change 36
36
"dependencies" : {
37
37
"accessible-autocomplete" : " ^3.0.1" ,
38
38
"clipboard" : " ^2.0.11" ,
39
- "govuk-frontend" : " ^5.10.2 " ,
39
+ "govuk-frontend" : " github:alphagov/govuk-frontend#718bbb72f " ,
40
40
"iframe-resizer" : " ^4.4.5" ,
41
41
"lunr" : " ^2.3.9"
42
42
},
Original file line number Diff line number Diff line change @@ -86,6 +86,21 @@ $app-code-color: #d13118;
86
86
@include govuk-width-container (1100px );
87
87
}
88
88
89
+ // Invert the colours of the navigation on the homepage
90
+ .govuk-template--rebranded .govuk-service-navigation--inverse {
91
+ // Override mobile menu toggles colour
92
+ .app-mobile-navigation-section__toggle {
93
+ color : govuk-colour (" white" );
94
+ border-top-color : $_govuk-rebrand-border-colour-on-blue-tint-95 ;
95
+ }
96
+
97
+ // Override link styles in sub menus
98
+ .app-mobile-navigation-section__item .govuk-service-navigation__link {
99
+ @include govuk-link-style-no-visited-state ;
100
+ @include govuk-link-style-no-underline ;
101
+ }
102
+ }
103
+
89
104
.app-main-wrapper {
90
105
padding-top : govuk-spacing (3 );
91
106
padding-bottom : govuk-spacing (4 );
Original file line number Diff line number Diff line change 1
1
{% extends " _generic.njk" %}
2
2
3
3
{% block body %}
4
- {# Only render breadcrumbs on pages that aren't the homepage. This is a bit
5
- hacky, but works as the homepage has an empty string for a permalink. #}
6
- {% if permalink %}
4
+ {# Only render breadcrumbs on pages that aren't the homepage. #}
5
+ {% if not isHomepage () %}
7
6
{{ govukBreadcrumbs ({
8
7
classes : " app-width-container" ,
9
8
items : getAncestorPages (permalink )
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ service navigation component. #}
33
33
{%- endfor %}
34
34
35
35
{{ govukServiceNavigation ({
36
+ classes : ' govuk-service-navigation--inverse' if isHomepage (),
36
37
navigation : navLinks ,
37
38
navigationClasses : ' app-service-navigation__wrapper'
38
39
}) }}
You can’t perform that action at this time.
0 commit comments