File tree Expand file tree Collapse file tree 4 files changed +44
-3
lines changed Expand file tree Collapse file tree 4 files changed +44
-3
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 @@ -86,6 +86,30 @@ $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
+ border-bottom-color : govuk-colour (" white" );
92
+ background-color : $govuk-brand-colour ;
93
+
94
+ // Override the 'active' border colour
95
+ .govuk-service-navigation__item ,
96
+ .govuk-service-navigation__service-name {
97
+ border-color : govuk-colour (" white" );
98
+ }
99
+
100
+ // Override mobile menu toggles colour
101
+ .govuk-service-navigation__toggle ,
102
+ .app-mobile-navigation-section__toggle {
103
+ color : govuk-colour (" white" );
104
+ }
105
+
106
+ // Override link styles, but only the ones on the top level,
107
+ // not those in sub menus
108
+ .govuk-service-navigation__item > .govuk-service-navigation__link {
109
+ @include govuk-link-style-inverse ;
110
+ }
111
+ }
112
+
89
113
.app-main-wrapper {
90
114
padding-top : govuk-spacing (3 );
91
115
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