govuk_publishing_components 12.20.0 → 12.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +2 -2
  3. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +8 -0
  4. data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +8 -8
  5. data/app/views/govuk_publishing_components/components/_contextual_footer.html.erb +10 -0
  6. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +5 -14
  7. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +5 -3
  8. data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +10 -6
  9. data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +3 -2
  10. data/app/views/govuk_publishing_components/components/docs/contextual_footer.yml +71 -0
  11. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +18 -9
  12. data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +17 -0
  13. data/app/views/govuk_publishing_components/components/docs/related_navigation.yml +53 -0
  14. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +10 -5
  15. data/config/locales/en.yml +5 -6
  16. data/lib/govuk_publishing_components.rb +0 -2
  17. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +0 -4
  18. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +108 -90
  19. data/lib/govuk_publishing_components/version.rb +1 -1
  20. data/node_modules/govuk-frontend/components/back-link/README.md +4 -73
  21. data/node_modules/govuk-frontend/components/breadcrumbs/README.md +4 -238
  22. data/node_modules/govuk-frontend/components/button/README.md +4 -174
  23. data/node_modules/govuk-frontend/components/character-count/README.md +4 -340
  24. data/node_modules/govuk-frontend/components/character-count/template.njk +0 -3
  25. data/node_modules/govuk-frontend/components/checkboxes/README.md +4 -705
  26. data/node_modules/govuk-frontend/components/checkboxes/template.njk +1 -0
  27. data/node_modules/govuk-frontend/components/date-input/README.md +4 -563
  28. data/node_modules/govuk-frontend/components/date-input/template.njk +1 -0
  29. data/node_modules/govuk-frontend/components/details/README.md +4 -128
  30. data/node_modules/govuk-frontend/components/error-message/README.md +4 -58
  31. data/node_modules/govuk-frontend/components/error-summary/README.md +4 -94
  32. data/node_modules/govuk-frontend/components/fieldset/README.md +4 -92
  33. data/node_modules/govuk-frontend/components/file-upload/README.md +4 -199
  34. data/node_modules/govuk-frontend/components/file-upload/template.njk +1 -0
  35. data/node_modules/govuk-frontend/components/footer/README.md +4 -91
  36. data/node_modules/govuk-frontend/components/footer/_footer.scss +22 -13
  37. data/node_modules/govuk-frontend/components/header/README.md +4 -351
  38. data/node_modules/govuk-frontend/components/hint/README.md +5 -77
  39. data/node_modules/govuk-frontend/components/input/README.md +4 -407
  40. data/node_modules/govuk-frontend/components/input/template.njk +1 -0
  41. data/node_modules/govuk-frontend/components/inset-text/README.md +4 -76
  42. data/node_modules/govuk-frontend/components/label/README.md +5 -97
  43. data/node_modules/govuk-frontend/components/panel/README.md +4 -93
  44. data/node_modules/govuk-frontend/components/phase-banner/README.md +4 -67
  45. data/node_modules/govuk-frontend/components/radios/README.md +4 -665
  46. data/node_modules/govuk-frontend/components/radios/template.njk +1 -0
  47. data/node_modules/govuk-frontend/components/select/README.md +4 -257
  48. data/node_modules/govuk-frontend/components/select/template.njk +1 -0
  49. data/node_modules/govuk-frontend/components/skip-link/README.md +4 -57
  50. data/node_modules/govuk-frontend/components/table/README.md +4 -368
  51. data/node_modules/govuk-frontend/components/tabs/README.md +4 -242
  52. data/node_modules/govuk-frontend/components/tag/README.md +4 -77
  53. data/node_modules/govuk-frontend/components/textarea/README.md +4 -193
  54. data/node_modules/govuk-frontend/components/textarea/template.njk +1 -0
  55. data/node_modules/govuk-frontend/components/warning-text/README.md +4 -63
  56. data/node_modules/govuk-frontend/components/warning-text/_warning-text.scss +1 -2
  57. data/node_modules/govuk-frontend/core/_lists.scss +17 -8
  58. data/node_modules/govuk-frontend/package.json +10 -10
  59. metadata +4 -5
  60. data/app/views/govuk_publishing_components/components/_taxonomy_navigation.html.erb +0 -116
  61. data/app/views/govuk_publishing_components/components/docs/taxonomy_navigation.yml +0 -119
  62. data/lib/govuk_publishing_components/presenters/taxonomy_navigation.rb +0 -47
@@ -31,6 +31,7 @@
31
31
  {{ govukErrorMessage({
32
32
  id: errorId,
33
33
  classes: params.errorMessage.classes,
34
+ attributes: params.errorMessage.attributes,
34
35
  html: params.errorMessage.html,
35
36
  text: params.errorMessage.text
36
37
  }) | indent(2) | trim }}
@@ -1,102 +1,15 @@
1
1
  # Footer
2
2
 
3
- ## Introduction
3
+ ## Installation
4
4
 
5
- The footer component is used at the bottom of every GOV.UK page, to help users navigate.
5
+ See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
6
6
 
7
- ## Guidance
7
+ ## Guidance and Examples
8
8
 
9
9
  Find out when to use the footer component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/footer).
10
10
 
11
- ## Quick start examples
12
-
13
- ### Footer
14
-
15
- [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/footer/preview)
16
-
17
- #### Markup
18
-
19
- <footer class="govuk-footer " role="contentinfo">
20
- <div class="govuk-width-container ">
21
-
22
- <div class="govuk-footer__meta">
23
- <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
24
-
25
- <svg
26
- role="presentation"
27
- focusable="false"
28
- class="govuk-footer__licence-logo"
29
- xmlns="http://www.w3.org/2000/svg"
30
- viewbox="0 0 483.2 195.7"
31
- height="17"
32
- width="41"
33
- >
34
- <path
35
- fill="currentColor"
36
- d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145"
37
- />
38
- </svg>
39
- <span class="govuk-footer__licence-description">
40
- All content is available under the
41
- <a
42
- class="govuk-footer__link"
43
- href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
44
- rel="license"
45
- >Open Government Licence v3.0</a>, except where otherwise stated
46
- </span>
47
- </div>
48
- <div class="govuk-footer__meta-item">
49
- <a
50
- class="govuk-footer__link govuk-footer__copyright-logo"
51
- href="https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/"
52
- >© Crown copyright</a>
53
- </div>
54
- </div>
55
- </div>
56
- </footer>
57
-
58
- #### Macro
59
-
60
- {% from "footer/macro.njk" import govukFooter %}
61
-
62
- {{ govukFooter({}) }}
63
-
64
- ## Requirements
65
-
66
- ### Build tool configuration
67
-
68
- When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
69
-
70
- .pipe(sass({
71
- includePaths: 'node_modules/'
72
- }))
73
-
74
- ### Static asset path configuration
75
-
76
- In order to include the images used in the components, you need to configure your app to show these assets. Below is a sample configuration using Express js:
77
-
78
- app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
79
-
80
11
  ## Component options
81
12
 
82
13
  Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
83
14
 
84
- See [options table](https://design-system.service.gov.uk/components/footer/#options-example-default) for details.
85
-
86
- ### Setting up Nunjucks views and paths
87
-
88
- Below is an example setup using express configure views:
89
-
90
- nunjucks.configure('node_modules/govuk-frontend/components', {
91
- autoescape: true,
92
- cache: false,
93
- express: app
94
- })
95
-
96
- ## Contribution
97
-
98
- Guidelines can be found at [on our Github repository.](https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md "link to contributing guidelines on our github repository")
99
-
100
- ## License
101
-
102
- MIT
15
+ See [options table](https://design-system.service.gov.uk/components/footer/#options-example-default) for details.
@@ -68,16 +68,20 @@
68
68
 
69
69
  .govuk-footer__meta {
70
70
  display: -webkit-box;
71
+ display: -webkit-flex;
71
72
  display: -ms-flexbox;
72
73
  display: flex; // Support: Flexbox
73
74
  margin-right: -$govuk-gutter-half;
74
75
  margin-left: -$govuk-gutter-half;
75
- -ms-flex-wrap: wrap;
76
- flex-wrap: wrap; // Support: Flexbox
76
+ -webkit-flex-wrap: wrap;
77
+ -ms-flex-wrap: wrap;
78
+ flex-wrap: wrap; // Support: Flexbox
77
79
  -webkit-box-align: end;
80
+ -webkit-align-items: flex-end;
78
81
  -ms-flex-align: end;
79
82
  align-items: flex-end; // Support: Flexbox
80
83
  -webkit-box-pack: center;
84
+ -webkit-justify-content: center;
81
85
  -ms-flex-pack: center;
82
86
  justify-content: center; // Support: Flexbox
83
87
  }
@@ -90,11 +94,13 @@
90
94
 
91
95
  .govuk-footer__meta-item--grow {
92
96
  -webkit-box-flex: 1;
97
+ -webkit-flex: 1;
93
98
  -ms-flex: 1;
94
99
  flex: 1; // Support: Flexbox
95
100
  @include mq ($until: tablet) {
96
- -ms-flex-preferred-size: 320px;
97
- flex-basis: 320px; // Support: Flexbox
101
+ -webkit-flex-basis: 320px;
102
+ -ms-flex-preferred-size: 320px;
103
+ flex-basis: 320px; // Support: Flexbox
98
104
  }
99
105
  }
100
106
 
@@ -154,12 +160,14 @@
154
160
 
155
161
  .govuk-footer__navigation {
156
162
  display: -webkit-box;
163
+ display: -webkit-flex;
157
164
  display: -ms-flexbox;
158
165
  display: flex; // Support: Flexbox
159
166
  margin-right: -$govuk-gutter-half;
160
167
  margin-left: -$govuk-gutter-half;
161
- -ms-flex-wrap: wrap;
162
- flex-wrap: wrap; // Support: Flexbox
168
+ -webkit-flex-wrap: wrap;
169
+ -ms-flex-wrap: wrap;
170
+ flex-wrap: wrap; // Support: Flexbox
163
171
  }
164
172
 
165
173
  .govuk-footer__section {
@@ -170,15 +178,18 @@
170
178
  vertical-align: top;
171
179
  // Ensure columns take up equal width (typically one-half:one-half)
172
180
  -webkit-box-flex: 1;
181
+ -webkit-flex-grow: 1;
173
182
  -ms-flex-positive: 1;
174
183
  flex-grow: 1; // Support: Flexbox
175
- -ms-flex-negative: 1;
176
- flex-shrink: 1; // Support: Flexbox
184
+ -webkit-flex-shrink: 1;
185
+ -ms-flex-negative: 1;
186
+ flex-shrink: 1; // Support: Flexbox
177
187
  @include mq ($until: desktop) {
178
188
  // Make sure columns do not drop below 200px in width
179
189
  // Will typically result in wrapping, and end up in a single column on smaller screens.
180
- -ms-flex-preferred-size: 200px;
181
- flex-basis: 200px; // Support: Flexbox
190
+ -webkit-flex-basis: 200px;
191
+ -ms-flex-preferred-size: 200px;
192
+ flex-basis: 200px; // Support: Flexbox
182
193
  }
183
194
  }
184
195
 
@@ -186,6 +197,7 @@
186
197
  @include mq ($from: desktop) {
187
198
  .govuk-footer__section:first-child {
188
199
  -webkit-box-flex: 2;
200
+ -webkit-flex-grow: 2;
189
201
  -ms-flex-positive: 2;
190
202
  flex-grow: 2; // Support: Flexbox
191
203
  }
@@ -196,20 +208,17 @@
196
208
  padding: 0;
197
209
  list-style: none;
198
210
  -webkit-column-gap: $govuk-gutter;
199
- -moz-column-gap: $govuk-gutter;
200
211
  column-gap: $govuk-gutter; // Support: Columns
201
212
  }
202
213
 
203
214
  @include mq ($from: desktop) {
204
215
  .govuk-footer__list--columns-2 {
205
216
  -webkit-column-count: 2;
206
- -moz-column-count: 2;
207
217
  column-count: 2; // Support: Columns
208
218
  }
209
219
 
210
220
  .govuk-footer__list--columns-3 {
211
221
  -webkit-column-count: 3;
212
- -moz-column-count: 3;
213
222
  column-count: 3; // Support: Columns
214
223
  }
215
224
  }
@@ -1,362 +1,15 @@
1
1
  # Header
2
2
 
3
- ## Introduction
3
+ ## Installation
4
4
 
5
- The header component is used at the top of every GOV.UK page, to help users navigate.
5
+ See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
6
6
 
7
- ## Guidance
7
+ ## Guidance and Examples
8
8
 
9
9
  Find out when to use the header component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/header).
10
10
 
11
- ## Quick start examples
12
-
13
- ### Header
14
-
15
- [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/header/preview)
16
-
17
- #### Markup
18
-
19
- <header class="govuk-header " role="banner" data-module="header">
20
- <div class="govuk-header__container govuk-width-container">
21
-
22
- <div class="govuk-header__logo">
23
- <a href="/" class="govuk-header__link govuk-header__link--homepage">
24
- <span class="govuk-header__logotype">
25
-
26
- <svg
27
- role="presentation"
28
- focusable="false"
29
- class="govuk-header__logotype-crown"
30
- xmlns="http://www.w3.org/2000/svg"
31
- viewbox="0 0 132 97"
32
- height="32"
33
- width="36"
34
- >
35
- <path
36
- fill="currentColor" fill-rule="evenodd"
37
- d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7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7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"
38
- ></path>
39
-
40
- <image src="/assets/images/govuk-logotype-crown.png" class="govuk-header__logotype-crown-fallback-image"></image>
41
- </svg>
42
- <span class="govuk-header__logotype-text">
43
- GOV.UK
44
- </span>
45
- </span>
46
-
47
- </a>
48
- </div>
49
-
50
- </div>
51
- </header>
52
-
53
- #### Macro
54
-
55
- {% from "header/macro.njk" import govukHeader %}
56
-
57
- {{ govukHeader({}) }}
58
-
59
- ### Header with service name
60
-
61
- [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/header/with-service-name/preview)
62
-
63
- #### Markup
64
-
65
- <header class="govuk-header " role="banner" data-module="header">
66
- <div class="govuk-header__container govuk-width-container">
67
-
68
- <div class="govuk-header__logo">
69
- <a href="/" class="govuk-header__link govuk-header__link--homepage">
70
- <span class="govuk-header__logotype">
71
-
72
- <svg
73
- role="presentation"
74
- focusable="false"
75
- class="govuk-header__logotype-crown"
76
- xmlns="http://www.w3.org/2000/svg"
77
- viewbox="0 0 132 97"
78
- height="32"
79
- width="36"
80
- >
81
- <path
82
- fill="currentColor" fill-rule="evenodd"
83
- d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM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 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"
84
- ></path>
85
-
86
- <image src="/assets/images/govuk-logotype-crown.png" class="govuk-header__logotype-crown-fallback-image"></image>
87
- </svg>
88
- <span class="govuk-header__logotype-text">
89
- GOV.UK
90
- </span>
91
- </span>
92
-
93
- </a>
94
- </div>
95
-
96
- <div class="govuk-header__content">
97
-
98
- <a href="/components/header" class="govuk-header__link govuk-header__link--service-name">
99
- Service Name
100
- </a>
101
-
102
- </div>
103
-
104
- </div>
105
- </header>
106
-
107
- #### Macro
108
-
109
- {% from "header/macro.njk" import govukHeader %}
110
-
111
- {{ govukHeader({
112
- "serviceName": "Service Name",
113
- "serviceUrl": "/components/header"
114
- }) }}
115
-
116
- ### Header with navigation
117
-
118
- [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/header/with-navigation/preview)
119
-
120
- #### Markup
121
-
122
- <header class="govuk-header " role="banner" data-module="header">
123
- <div class="govuk-header__container govuk-width-container">
124
-
125
- <div class="govuk-header__logo">
126
- <a href="/" class="govuk-header__link govuk-header__link--homepage">
127
- <span class="govuk-header__logotype">
128
-
129
- <svg
130
- role="presentation"
131
- focusable="false"
132
- class="govuk-header__logotype-crown"
133
- xmlns="http://www.w3.org/2000/svg"
134
- viewbox="0 0 132 97"
135
- height="32"
136
- width="36"
137
- >
138
- <path
139
- fill="currentColor" fill-rule="evenodd"
140
- d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4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7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"
141
- ></path>
142
-
143
- <image src="/assets/images/govuk-logotype-crown.png" class="govuk-header__logotype-crown-fallback-image"></image>
144
- </svg>
145
- <span class="govuk-header__logotype-text">
146
- GOV.UK
147
- </span>
148
- </span>
149
-
150
- </a>
151
- </div>
152
-
153
- <div class="govuk-header__content">
154
-
155
- <button type="button" role="button" class="govuk-header__menu-button js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button>
156
- <nav>
157
- <ul id="navigation" class="govuk-header__navigation " aria-label="Top Level Navigation">
158
-
159
- <li class="govuk-header__navigation-item govuk-header__navigation-item--active">
160
- <a class="govuk-header__link" href="#1">
161
- Navigation item 1
162
- </a>
163
- </li>
164
-
165
- <li class="govuk-header__navigation-item">
166
- <a class="govuk-header__link" href="#2">
167
- Navigation item 2
168
- </a>
169
- </li>
170
-
171
- <li class="govuk-header__navigation-item">
172
- <a class="govuk-header__link" href="#3">
173
- Navigation item 3
174
- </a>
175
- </li>
176
-
177
- <li class="govuk-header__navigation-item">
178
- <a class="govuk-header__link" href="#4">
179
- Navigation item 4
180
- </a>
181
- </li>
182
-
183
- </ul>
184
- </nav>
185
-
186
- </div>
187
-
188
- </div>
189
- </header>
190
-
191
- #### Macro
192
-
193
- {% from "header/macro.njk" import govukHeader %}
194
-
195
- {{ govukHeader({
196
- "navigation": [
197
- {
198
- "href": "#1",
199
- "text": "Navigation item 1",
200
- "active": true
201
- },
202
- {
203
- "href": "#2",
204
- "text": "Navigation item 2"
205
- },
206
- {
207
- "href": "#3",
208
- "text": "Navigation item 3"
209
- },
210
- {
211
- "href": "#4",
212
- "text": "Navigation item 4"
213
- }
214
- ]
215
- }) }}
216
-
217
- ### Header with service name and navigation
218
-
219
- [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/header/with-service-name-and-navigation/preview)
220
-
221
- #### Markup
222
-
223
- <header class="govuk-header " role="banner" data-module="header">
224
- <div class="govuk-header__container govuk-width-container">
225
-
226
- <div class="govuk-header__logo">
227
- <a href="/" class="govuk-header__link govuk-header__link--homepage">
228
- <span class="govuk-header__logotype">
229
-
230
- <svg
231
- role="presentation"
232
- focusable="false"
233
- class="govuk-header__logotype-crown"
234
- xmlns="http://www.w3.org/2000/svg"
235
- viewbox="0 0 132 97"
236
- height="32"
237
- width="36"
238
- >
239
- <path
240
- fill="currentColor" fill-rule="evenodd"
241
- d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 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9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"
242
- ></path>
243
-
244
- <image src="/assets/images/govuk-logotype-crown.png" class="govuk-header__logotype-crown-fallback-image"></image>
245
- </svg>
246
- <span class="govuk-header__logotype-text">
247
- GOV.UK
248
- </span>
249
- </span>
250
-
251
- </a>
252
- </div>
253
-
254
- <div class="govuk-header__content">
255
-
256
- <a href="/components/header" class="govuk-header__link govuk-header__link--service-name">
257
- Service Name
258
- </a>
259
-
260
- <button type="button" role="button" class="govuk-header__menu-button js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button>
261
- <nav>
262
- <ul id="navigation" class="govuk-header__navigation " aria-label="Top Level Navigation">
263
-
264
- <li class="govuk-header__navigation-item govuk-header__navigation-item--active">
265
- <a class="govuk-header__link" href="#1">
266
- Navigation item 1
267
- </a>
268
- </li>
269
-
270
- <li class="govuk-header__navigation-item">
271
- <a class="govuk-header__link" href="#2">
272
- Navigation item 2
273
- </a>
274
- </li>
275
-
276
- <li class="govuk-header__navigation-item">
277
- <a class="govuk-header__link" href="#3">
278
- Navigation item 3
279
- </a>
280
- </li>
281
-
282
- <li class="govuk-header__navigation-item">
283
- <a class="govuk-header__link" href="#4">
284
- Navigation item 4
285
- </a>
286
- </li>
287
-
288
- </ul>
289
- </nav>
290
-
291
- </div>
292
-
293
- </div>
294
- </header>
295
-
296
- #### Macro
297
-
298
- {% from "header/macro.njk" import govukHeader %}
299
-
300
- {{ govukHeader({
301
- "serviceName": "Service Name",
302
- "serviceUrl": "/components/header",
303
- "navigation": [
304
- {
305
- "href": "#1",
306
- "text": "Navigation item 1",
307
- "active": true
308
- },
309
- {
310
- "href": "#2",
311
- "text": "Navigation item 2"
312
- },
313
- {
314
- "href": "#3",
315
- "text": "Navigation item 3"
316
- },
317
- {
318
- "href": "#4",
319
- "text": "Navigation item 4"
320
- }
321
- ]
322
- }) }}
323
-
324
- ## Requirements
325
-
326
- ### Build tool configuration
327
-
328
- When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
329
-
330
- .pipe(sass({
331
- includePaths: 'node_modules/'
332
- }))
333
-
334
- ### Static asset path configuration
335
-
336
- In order to include the images used in the components, you need to configure your app to show these assets. Below is a sample configuration using Express js:
337
-
338
- app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
339
-
340
11
  ## Component options
341
12
 
342
13
  Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
343
14
 
344
- See [options table](https://design-system.service.gov.uk/components/header/#options-example-default) for details.
345
-
346
- ### Setting up Nunjucks views and paths
347
-
348
- Below is an example setup using express configure views:
349
-
350
- nunjucks.configure('node_modules/govuk-frontend/components', {
351
- autoescape: true,
352
- cache: false,
353
- express: app
354
- })
355
-
356
- ## Contribution
357
-
358
- Guidelines can be found at [on our Github repository.](https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md "link to contributing guidelines on our github repository")
359
-
360
- ## License
361
-
362
- MIT
15
+ See [options table](https://design-system.service.gov.uk/components/header/#options-example-default) for details.