@ons/design-system 59.0.0 → 60.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/components/access-code/uac.scss +1 -1
  2. package/components/autosuggest/_autosuggest.scss +1 -1
  3. package/components/button/_button.scss +3 -3
  4. package/components/download-resources/_download-resources.scss +1 -1
  5. package/components/fieldset/_fieldset.scss +2 -2
  6. package/components/footer/_footer.scss +0 -15
  7. package/components/footer/_macro.njk +62 -103
  8. package/components/footer/_macro.spec.js +56 -186
  9. package/components/header/_header.scss +23 -25
  10. package/components/header/_macro.njk +133 -148
  11. package/components/header/_macro.spec.js +39 -73
  12. package/components/hero/_hero.scss +4 -0
  13. package/components/hero/_macro.njk +35 -92
  14. package/components/hero/_macro.spec.js +54 -190
  15. package/components/icons/_macro.njk +0 -499
  16. package/components/icons/_macro.spec.js +0 -14
  17. package/components/navigation/_macro.njk +14 -14
  18. package/components/navigation/_macro.spec.js +3 -5
  19. package/components/navigation/_navigation.scss +4 -4
  20. package/components/panel/_panel.scss +1 -1
  21. package/components/summary/_summary.scss +2 -2
  22. package/components/table/_table.scss +3 -3
  23. package/css/main.css +3 -3
  24. package/fonts/opensans-bold.woff +0 -0
  25. package/fonts/opensans-bold.woff2 +0 -0
  26. package/fonts/opensans-regular.woff +0 -0
  27. package/fonts/opensans-regular.woff2 +0 -0
  28. package/img/large/placeholder-card.png +0 -0
  29. package/img/large/placeholder-news-medium.png +0 -0
  30. package/img/large/placeholder-news.png +0 -0
  31. package/img/large/placeholder-portrait.png +0 -0
  32. package/img/small/placeholder-card.png +0 -0
  33. package/img/small/placeholder-news-medium.png +0 -0
  34. package/img/small/placeholder-news.png +0 -0
  35. package/img/small/placeholder-portrait.png +0 -0
  36. package/js/main.js +0 -1
  37. package/layout/_template.njk +51 -62
  38. package/package.json +1 -1
  39. package/scripts/main.es5.js +1 -1
  40. package/scripts/main.js +1 -1
  41. package/scss/base/_typography.scss +1 -0
  42. package/scss/main.scss +0 -2
  43. package/scss/patternlib.scss +2 -1
  44. package/scss/utilities/_typography.scss +1 -1
  45. package/scss/vars/_colors.scss +9 -4
  46. package/scss/vars/_typography.scss +1 -1
  47. package/components/find-a-support-centre/_find-a-support-centre.scss +0 -9
  48. package/components/promotional-banner/_macro.njk +0 -49
  49. package/components/promotional-banner/_macro.spec.js +0 -97
  50. package/components/promotional-banner/_promo-banner.scss +0 -72
  51. package/components/select/select.js +0 -19
  52. package/components/select/select.spec.js +0 -56
  53. package/css/census.css +0 -243
  54. package/css/ids.css +0 -243
  55. package/favicons/browserconfig.xml +0 -12
  56. package/favicons/census/cy/android-chrome-192x192.png +0 -0
  57. package/favicons/census/cy/android-chrome-512x512.png +0 -0
  58. package/favicons/census/cy/apple-touch-icon.png +0 -0
  59. package/favicons/census/cy/browserconfig.xml +0 -12
  60. package/favicons/census/cy/favicon-16x16.png +0 -0
  61. package/favicons/census/cy/favicon-32x32.png +0 -0
  62. package/favicons/census/cy/favicon.ico +0 -0
  63. package/favicons/census/cy/manifest.json +0 -20
  64. package/favicons/census/cy/mstitle-150x150.png +0 -0
  65. package/favicons/census/cy/mstitle-310x150.png +0 -0
  66. package/favicons/census/cy/mstitle-310x310.png +0 -0
  67. package/favicons/census/cy/mstitle-70x70.png +0 -0
  68. package/favicons/census/cy/opengraph.png +0 -0
  69. package/favicons/census/cy/safari-pinned-tab.svg +0 -3
  70. package/favicons/census/cy/site.webmanifest +0 -19
  71. package/favicons/census/cy/twitter.png +0 -0
  72. package/favicons/census/en/android-chrome-192x192.png +0 -0
  73. package/favicons/census/en/android-chrome-512x512.png +0 -0
  74. package/favicons/census/en/apple-touch-icon.png +0 -0
  75. package/favicons/census/en/browserconfig.xml +0 -12
  76. package/favicons/census/en/favicon-16x16.png +0 -0
  77. package/favicons/census/en/favicon-32x32.png +0 -0
  78. package/favicons/census/en/favicon.ico +0 -0
  79. package/favicons/census/en/manifest.json +0 -20
  80. package/favicons/census/en/mstitle-150x150.png +0 -0
  81. package/favicons/census/en/mstitle-310x150.png +0 -0
  82. package/favicons/census/en/mstitle-310x310.png +0 -0
  83. package/favicons/census/en/mstitle-70x70.png +0 -0
  84. package/favicons/census/en/opengraph.png +0 -0
  85. package/favicons/census/en/safari-pinned-tab.svg +0 -3
  86. package/favicons/census/en/site.webmanifest +0 -19
  87. package/favicons/census/en/twitter.png +0 -0
  88. package/favicons/census/ni/favicon.ico +0 -0
  89. package/favicons/ids/cy/android-chrome-192x192.png +0 -0
  90. package/favicons/ids/cy/android-chrome-512x512.png +0 -0
  91. package/favicons/ids/cy/apple-touch-icon.png +0 -0
  92. package/favicons/ids/cy/browserconfig.xml +0 -12
  93. package/favicons/ids/cy/favicon-16x16.png +0 -0
  94. package/favicons/ids/cy/favicon-32x32.png +0 -0
  95. package/favicons/ids/cy/favicon.ico +0 -0
  96. package/favicons/ids/cy/manifest.json +0 -20
  97. package/favicons/ids/cy/mstile-150x150.png +0 -0
  98. package/favicons/ids/cy/mstile-310x150.png +0 -0
  99. package/favicons/ids/cy/mstile-310x310.png +0 -0
  100. package/favicons/ids/cy/mstile-70x70.png +0 -0
  101. package/favicons/ids/cy/opengraph.png +0 -0
  102. package/favicons/ids/cy/safari-pinned-tab.svg +0 -27
  103. package/favicons/ids/cy/site.webmanifest +0 -54
  104. package/favicons/ids/cy/twitter.png +0 -0
  105. package/favicons/ids/en/android-chrome-192x192.png +0 -0
  106. package/favicons/ids/en/android-chrome-512x512.png +0 -0
  107. package/favicons/ids/en/apple-touch-icon.png +0 -0
  108. package/favicons/ids/en/browserconfig.xml +0 -12
  109. package/favicons/ids/en/favicon-16x16.png +0 -0
  110. package/favicons/ids/en/favicon-32x32.png +0 -0
  111. package/favicons/ids/en/favicon.ico +0 -0
  112. package/favicons/ids/en/manifest.json +0 -20
  113. package/favicons/ids/en/mstile-150x150.png +0 -0
  114. package/favicons/ids/en/mstile-310x150.png +0 -0
  115. package/favicons/ids/en/mstile-310x310.png +0 -0
  116. package/favicons/ids/en/mstile-70x70.png +0 -0
  117. package/favicons/ids/en/opengraph.png +0 -0
  118. package/favicons/ids/en/safari-pinned-tab.svg +0 -27
  119. package/favicons/ids/en/site.webmanifest +0 -54
  120. package/favicons/ids/en/twitter.png +0 -0
  121. package/favicons/mstitle-150x150.png +0 -0
  122. package/favicons/mstitle-310x150.png +0 -0
  123. package/favicons/mstitle-310x310.png +0 -0
  124. package/favicons/mstitle-70x70.png +0 -0
  125. package/img/UKOpenGovernmentLicence-grey.svg +0 -4
  126. package/img/UKOpenGovernmentLicence.svg +0 -13
  127. package/img/card-placeholder.svg +0 -14
  128. package/img/census-landscape.svg +0 -4514
  129. package/img/census-logo-stacked-pos-billingual.png +0 -0
  130. package/img/census-logo-stacked-pos-cy.png +0 -0
  131. package/img/census-logo-stacked-pos-en.png +0 -0
  132. package/img/census-promo-banner.svg +0 -489
  133. package/img/circle-lines.svg +0 -31
  134. package/img/dummy-brand-logo.svg +0 -6
  135. package/img/icons--check.svg +0 -3
  136. package/img/icons--chevron-down.svg +0 -3
  137. package/img/its-about-us--dark.svg +0 -4
  138. package/img/its-about-us--light.svg +0 -4
  139. package/img/large/hero-man.png +0 -0
  140. package/img/logo.svg +0 -77
  141. package/img/ni-syn-cyfrif--dark.svg +0 -3
  142. package/img/ni-syn-cyfrif--light.svg +0 -3
  143. package/img/nisra-logo-black-en.svg +0 -4
  144. package/img/ogl.svg +0 -10
  145. package/img/ons-logo-black-cy.svg +0 -4
  146. package/img/ons-logo-black-en.svg +0 -4
  147. package/img/people-mob.png +0 -0
  148. package/img/people.png +0 -0
  149. package/img/rehearsal-areas.svg +0 -11
  150. package/img/small/hero-man.png +0 -0
  151. package/scss/census.scss +0 -2
  152. package/scss/ids.scss +0 -2
  153. package/scss/settings/_census.scss +0 -159
  154. package/scss/settings/_ids.scss +0 -52
@@ -12,15 +12,10 @@
12
12
  width: 100%;
13
13
  }
14
14
  &__grid-top {
15
- height: 54px;
15
+ padding: 1rem 0;
16
16
 
17
17
  @include mq(xs) {
18
- height: 46px;
19
- }
20
- }
21
- &__grid-top-tall {
22
- @include mq(xs) {
23
- height: 76px;
18
+ padding: 0.75rem 0;
24
19
  }
25
20
  }
26
21
  &__main {
@@ -114,20 +109,29 @@
114
109
 
115
110
  &--neutral & {
116
111
  &__top {
117
- background: var(--ons-color-header-masthead-dark);
112
+ background: var(--ons-color-header-masthead-neutral);
113
+ }
114
+
115
+ &__grid-top {
116
+ a {
117
+ color: var(--ons-color-service-links);
118
+ &:hover {
119
+ text-decoration: underline solid var(--ons-color-service-links) 3px;
120
+ }
121
+ }
118
122
  }
119
123
 
120
124
  &__main {
121
- background: var(--ons-color-header-light);
125
+ background: var(--ons-color-header-neutral);
122
126
 
123
127
  &--border {
124
- border-bottom: 3px solid var(--ons-color-header-light);
125
- border-top: 3px solid var(--ons-color-header-light);
128
+ border-bottom: 3px solid var(--ons-color-header-neutral);
129
+ border-top: 3px solid var(--ons-color-header-neutral);
126
130
  }
127
131
  }
128
132
 
129
133
  &__title {
130
- color: var(--ons-color-branded-text);
134
+ color: var(--ons-color-header-title);
131
135
  &-link {
132
136
  &:hover {
133
137
  text-decoration: underline solid var(--ons-color-branded-text) 2px;
@@ -143,6 +147,13 @@
143
147
  &__org-logo-link,
144
148
  &__title-logo-link {
145
149
  display: block;
150
+ font-size: 0;
151
+ &:hover {
152
+ text-decoration: none;
153
+ }
154
+ }
155
+
156
+ &__org-logo-link {
146
157
  &:focus {
147
158
  .ons-svg-logo {
148
159
  fill: var(--ons-color-black) !important;
@@ -151,19 +162,6 @@
151
162
  }
152
163
  }
153
164
  }
154
- &:hover {
155
- font-size: 0;
156
- text-decoration: none;
157
- }
158
- }
159
-
160
- &__title-logo--large {
161
- .ons-svg-logo {
162
- @include mq(xxs, 399px) {
163
- height: auto;
164
- max-width: 160px;
165
- }
166
- }
167
165
  }
168
166
 
169
167
  &__org-logo--large {
@@ -30,175 +30,168 @@
30
30
  "html": params.phase.html
31
31
  }) }}
32
32
  {% endif %}
33
- {% if params.noMasthead != true %}
34
- <div class="ons-header__top">
35
- <div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
36
- <div class="ons-header__grid-top ons-grid ons-grid--gutterless ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap{{ ' ons-header__grid-top-tall' if params.customHeaderLogo }}">
37
- <div class="ons-grid__col ons-col-auto">
38
- {%-if params.orgLogoHref %}
39
- <a class="ons-header__org-logo-link" href="{{ params.orgLogoHref }}">
40
- {% endif -%}
41
- <div class="ons-header__org-logo ons-header__org-logo--large">
42
-
33
+ <div class="ons-header__top">
34
+ <div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
35
+ <div class="ons-header__grid-top ons-grid ons-grid--gutterless ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap{% if params.mastheadLogo.classes %} {{ params.mastheadLogo.classes }}{% endif %}">
36
+ <div class="ons-grid__col ons-col-auto">
37
+ {%-if params.mastheadLogoUrl %}
38
+ <a class="ons-header__org-logo-link" href="{{ params.mastheadLogoUrl }}">
39
+ {% endif -%}
40
+ <div class="ons-header__org-logo ons-header__org-logo--large">
41
+ {% if params.mastheadLogo.large %}
42
+ {{ params.mastheadLogo.large | safe }}
43
+ {% else %}
43
44
  {{
44
45
  onsIcon({
45
- "iconType": params.orgLogo | default('ons-logo-' + currentLanguageISOCode),
46
- "altText": params.orgLogoAlt | default('Office for National Statistics logo')
46
+ "iconType": 'ons-logo-' + currentLanguageISOCode,
47
+ "altText": 'Office for National Statistics logo'
47
48
  })
48
49
  }}
49
- </div>
50
- <div class="ons-header__org-logo ons-header__org-logo--small">
50
+ {% endif %}
51
+ </div>
52
+ <div class="ons-header__org-logo ons-header__org-logo--small">
53
+ {% if params.mastheadLogo.small or params.mastheadLogo.large %}
54
+ {{ params.mastheadLogo.small | safe }}
55
+ {% else %}
51
56
  {{
52
57
  onsIcon({
53
- "iconType": params.orgMobileLogo | default('ons-logo-stacked-' + currentLanguageISOCode),
54
- "altText": params.orgLogoAlt | default('Office for National Statistics logo')
58
+ "iconType": 'ons-logo-stacked-' + currentLanguageISOCode,
59
+ "altText": 'Office for National Statistics logo'
55
60
  })
56
61
  }}
57
- </div>
58
- {% if params.orgLogoHref %}
59
- </a>
60
62
  {% endif %}
61
63
  </div>
62
- {% if params.language or params.serviceLinks %}
63
- <div class="ons-header__links ons-grid__col ons-col-auto">
64
- {% if params.language %}
65
- <div class="ons-grid__col ons-col-auto {{ ' ons-u-mr-s ons-u-d-no@xxs@xs' if params.serviceLinks else '' }}">
66
- {% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
67
- {{ onsLanguageSelector(params.language) }}
68
- </div>
69
- {% endif %}
70
- {% if params.serviceLinks %}
71
- {% if params.serviceLinks.itemsList | length == 1 and params.language %}
72
- {% set breakpoint = 'xs' %}
73
- {% set controlVisibility = true %}
74
- {% elif params.serviceLinks.itemsList | length > 1 %}
75
- {% set breakpoint = 'm' %}
76
- {% set controlVisibility = true %}
77
- {% else %}
78
- {% set controlVisibility = false %}
79
- {% endif %}
80
- <div class="ons-grid__col ons-col-auto{% if controlVisibility == true %} ons-u-d-no@xxs@{{ breakpoint }}{% endif %}">
81
- <nav class="ons-header-service-nav ons-header-service-nav--main {{ params.serviceLinks.classes }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
82
- <ul class="ons-header-service-nav__list">
83
- {% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
84
- <li class="ons-header-service-nav__item">
85
- {% if item.iconType %}
86
- {{
87
- onsIcon({
88
- "iconType": item.iconType
89
- })
90
- }}
91
- {% endif %}
92
- {% if item.url %}
93
- <a
94
- href="{{ item.url }}"
95
- class="ons-header-service-nav__link"
96
- {% if item.id %} id="{{ item.id }}"{% endif %}
97
- >{{ item.title }}</a>
98
- {% else %}
99
- {{ item.title }}
100
- {% endif %}
101
- </li>
102
- {% endfor %}
103
- </ul>
104
- </nav>
105
- </div>
106
- {% if params.serviceLinks.itemsList | length > 1 or params.language %}
107
- {% if params.variants == 'internal' or params.variants == 'neutral' %}
108
- {% set buttonVariant = ["mobile", "text-link", "text-link-inverse"] %}
109
- {% else %}
110
- {% set buttonVariant = ["mobile", "text-link"] %}
111
- {% endif %}
112
- <div class="ons-grid__col ons-col-auto ons-u-d-no@{{ breakpoint }}">
113
- {{ onsButton({
114
- "text": params.serviceLinks.toggleServicesButton.text | default("Account"),
115
- "classes": "ons-u-d-no ons-js-toggle-services",
116
- "type": "button",
117
- "variants": buttonVariant,
118
- "attributes": {
119
- "aria-label": params.serviceLinks.toggleServicesButton.ariaLabel | default("Toggle menu"),
120
- "aria-controls": params.serviceLinks.id,
121
- "aria-expanded": "false"
122
- }
123
- }) }}
124
- </div>
125
- {% endif %}
126
- {% endif %}
127
- </div>
64
+ {% if params.mastheadLogoUrl %}
65
+ </a>
128
66
  {% endif %}
129
67
  </div>
130
- </div>
131
- {% if params.serviceLinks %}
132
- <nav class="ons-header-service-nav ons-header-service-nav--mobile ons-u-d-no ons-js-services-mobile-nav" id="{{ params.serviceLinks.id }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
133
- <ul class="ons-header-service-nav__list">
134
- {% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
135
- <li class="ons-header-service-nav__item ons-header-service-nav__item--mobile">
136
- {% if item.iconType %}
137
- {{
138
- onsIcon({
139
- "iconType": item.iconType
140
- })
141
- }}
142
- {% endif %}
143
- {% if item.url %}
144
- <a
145
- href="{{ item.url }}"
146
- class="ons-header-service-nav__link"
147
- {% if item.id %} id="{{ item.id }}"{% endif %}
148
- >{{ item.title }}</a>
149
- {% else %}
150
- {{ item.title }}
151
- {% endif %}
152
- </li>
153
- {% endfor %}
68
+ {% if params.language or params.serviceLinks %}
69
+ <div class="ons-header__links ons-grid__col ons-col-auto">
154
70
  {% if params.language %}
155
- <div class="ons-u-d-no@xs">
71
+ <div class="ons-grid__col ons-col-auto {{ ' ons-u-mr-s ons-u-d-no@xxs@xs' if params.serviceLinks else '' }}">
156
72
  {% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
157
73
  {{ onsLanguageSelector(params.language) }}
158
74
  </div>
159
75
  {% endif %}
160
- </ul>
161
- </nav>
162
- {% endif %}
76
+ {% if params.serviceLinks %}
77
+ {% if params.serviceLinks.itemsList | length == 1 and params.language %}
78
+ {% set breakpoint = 'xs' %}
79
+ {% set controlVisibility = true %}
80
+ {% elif params.serviceLinks.itemsList | length > 1 %}
81
+ {% set breakpoint = 'm' %}
82
+ {% set controlVisibility = true %}
83
+ {% else %}
84
+ {% set controlVisibility = false %}
85
+ {% endif %}
86
+ <div class="ons-grid__col ons-col-auto{% if controlVisibility == true %} ons-u-d-no@xxs@{{ breakpoint }}{% endif %}">
87
+ <nav class="ons-header-service-nav ons-header-service-nav--main {{ params.serviceLinks.classes }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
88
+ <ul class="ons-header-service-nav__list">
89
+ {% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
90
+ <li class="ons-header-service-nav__item">
91
+ {% if item.iconType %}
92
+ {{
93
+ onsIcon({
94
+ "iconType": item.iconType
95
+ })
96
+ }}
97
+ {% endif %}
98
+ {% if item.url %}
99
+ <a
100
+ href="{{ item.url }}"
101
+ class="ons-header-service-nav__link"
102
+ {% if item.id %} id="{{ item.id }}"{% endif %}
103
+ >{{ item.title }}</a>
104
+ {% else %}
105
+ {{ item.title }}
106
+ {% endif %}
107
+ </li>
108
+ {% endfor %}
109
+ </ul>
110
+ </nav>
111
+ </div>
112
+ {% if params.serviceLinks.itemsList | length > 1 or params.language %}
113
+ {% if params.variants == 'internal' or params.variants == 'neutral' %}
114
+ {% set buttonVariant = ["mobile", "text-link", "text-link-inverse"] %}
115
+ {% else %}
116
+ {% set buttonVariant = ["mobile", "text-link"] %}
117
+ {% endif %}
118
+ <div class="ons-grid__col ons-col-auto ons-u-d-no@{{ breakpoint }}">
119
+ {{ onsButton({
120
+ "text": params.serviceLinks.toggleServicesButton.text | default("Account"),
121
+ "classes": "ons-u-d-no ons-js-toggle-services",
122
+ "type": "button",
123
+ "variants": buttonVariant,
124
+ "attributes": {
125
+ "aria-label": params.serviceLinks.toggleServicesButton.ariaLabel | default("Toggle menu"),
126
+ "aria-controls": params.serviceLinks.id,
127
+ "aria-expanded": "false"
128
+ }
129
+ }) }}
130
+ </div>
131
+ {% endif %}
132
+ {% endif %}
133
+ </div>
134
+ {% endif %}
135
+ </div>
163
136
  </div>
164
- {% endif %}
137
+ {% if params.serviceLinks %}
138
+ <nav class="ons-header-service-nav ons-header-service-nav--mobile ons-u-d-no ons-js-services-mobile-nav" id="{{ params.serviceLinks.id }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
139
+ <ul class="ons-header-service-nav__list">
140
+ {% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
141
+ <li class="ons-header-service-nav__item ons-header-service-nav__item--mobile">
142
+ {% if item.iconType %}
143
+ {{
144
+ onsIcon({
145
+ "iconType": item.iconType
146
+ })
147
+ }}
148
+ {% endif %}
149
+ {% if item.url %}
150
+ <a
151
+ href="{{ item.url }}"
152
+ class="ons-header-service-nav__link"
153
+ {% if item.id %} id="{{ item.id }}"{% endif %}
154
+ >{{ item.title }}</a>
155
+ {% else %}
156
+ {{ item.title }}
157
+ {% endif %}
158
+ </li>
159
+ {% endfor %}
160
+ {% if params.language %}
161
+ <div class="ons-u-d-no@xs">
162
+ {% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
163
+ {{ onsLanguageSelector(params.language) }}
164
+ </div>
165
+ {% endif %}
166
+ </ul>
167
+ </nav>
168
+ {% endif %}
169
+ </div>
165
170
  <div class="ons-header__main">
166
171
  <div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
167
172
  <div class="ons-grid ons-grid--gutterless ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap">
168
173
  <div class="ons-grid__col ons-col-auto ons-u-flex-shrink">
169
- {% if params.titleLogo and params.titleLogoAlt %}
170
- {% if params.titleLogoHref %}
171
- <a class="ons-header__title-logo-link" href="{{ params.titleLogoHref }}">
174
+ {% if params.titleLogo.large %}
175
+ {% if params.titleUrl %}
176
+ <a class="ons-header__title-logo-link" href="{{ params.titleUrl }}">
172
177
  {% endif %}
173
- <div class="ons-header__title-logo ons-header__title-logo--large {% if params.titleLogoClasses %} {{ params.titleLogoClasses }} {% endif %}{% if params.titleLogoMobile %}ons-u-d-no@xxs@s{% endif %}">
174
- {% from "components/icons/_macro.njk" import onsIcon %}
175
- {{
176
- onsIcon({
177
- "iconType": params.titleLogo,
178
- "altText": params.titleLogoAlt
179
- })
180
- }}
178
+ <div class="ons-header__title-logo ons-header__title-logo--large {% if params.titleLogo.classes %} {{ params.titleLogo.classes }} {% endif %}{% if params.titleLogo.small %}ons-u-d-no@xxs@s{% endif %}">
179
+ {{ params.titleLogo.large | safe }}
181
180
  </div>
182
- {% if params.titleLogoMobile %}
183
- <div class="ons-header__title-logo ons-header__title-logo--mobile ons-u-d-no@s{% if params.titleLogoMobileClasses %} {{ params.titleLogoMobileClasses }}{% endif %}">
184
- {% from "components/icons/_macro.njk" import onsIcon %}
185
- {{
186
- onsIcon({
187
- "iconType": params.titleLogoMobile,
188
- "altText": params.titleLogoAlt
189
- })
190
- }}
181
+ {% if params.titleLogo.small %}
182
+ <div class="ons-header__title-logo ons-header__title-logo--small ons-u-d-no@s{% if params.titleLogo.classes %} {{ params.titleLogo.classes }}{% endif %}">
183
+ {{ params.titleLogo.small | safe}}
191
184
  </div>
192
185
  {% endif %}
193
- {% if params.titleLogoHref %}
186
+ {% if params.titleUrl %}
194
187
  </a>
195
188
  {% endif %}
196
189
  {% else %}
197
- {% if params.titleLogoHref %}
198
- <a class="ons-header__title-link" href="{{ params.titleLogoHref }}">
190
+ {% if params.titleUrl %}
191
+ <a class="ons-header__title-link" href="{{ params.titleUrl }}">
199
192
  {% endif %}
200
193
  <{{ title_tag }} class="ons-header__title">{{ params.title }}</{{ title_tag }}>
201
- {% if params.titleLogoHref %}
194
+ {% if params.titleUrl %}
202
195
  </a>
203
196
  {% endif %}
204
197
  {% endif %}
@@ -226,17 +219,9 @@
226
219
  }) }}
227
220
  </div>
228
221
  {% endif %}
229
- {% if params.navigation %}
222
+ {% if params.navigation or params.siteSearchAutosuggest %}
230
223
  <div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink">
231
- {% if params.noMasthead == true %}
232
- {% if params.language %}
233
- <div class="ons-grid__col ons-col-auto ons-u-mt-xxs@xxs@l ons-u-mr-xs@xxs@s {% if params.navigation.siteSearchAutosuggest %}ons-header__lang-adjustment{% endif %}">
234
- {% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
235
- {{ onsLanguageSelector(params.language) }}
236
- </div>
237
- {% endif %}
238
- {% endif %}
239
- {% if params.navigation.siteSearchAutosuggest %}
224
+ {% if params.siteSearchAutosuggest %}
240
225
  {% if params.variants == 'neutral' %}
241
226
  {% set buttonVariant = ["small", "ghost-dark"] %}
242
227
  {% else %}
@@ -163,7 +163,7 @@ describe('macro: header', () => {
163
163
  });
164
164
 
165
165
  it('has the correct masthead logo link', () => {
166
- const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_BASIC, orgLogoHref: '#0' }));
166
+ const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_BASIC, mastheadLogoUrl: '#0' }));
167
167
 
168
168
  expect($('.ons-header__org-logo-link').attr('href')).toBe('#0');
169
169
  });
@@ -177,13 +177,13 @@ describe('macro: header', () => {
177
177
  expect(iconsSpy.occurrences[0].iconType).toBe('ons-logo-en');
178
178
  });
179
179
 
180
- it('has the provided masthead logo icon', () => {
180
+ it('has the default masthead mobile logo icon', () => {
181
181
  const faker = templateFaker();
182
182
  const iconsSpy = faker.spy('icons');
183
183
 
184
- faker.renderComponent('header', { ...EXAMPLE_HEADER_BASIC, orgLogo: 'another-logo' });
184
+ faker.renderComponent('header', EXAMPLE_HEADER_BASIC);
185
185
 
186
- expect(iconsSpy.occurrences[0].iconType).toBe('another-logo');
186
+ expect(iconsSpy.occurrences[1].iconType).toBe('ons-logo-stacked-en');
187
187
  });
188
188
 
189
189
  it('has the default masthead logo icon alt text', () => {
@@ -195,49 +195,44 @@ describe('macro: header', () => {
195
195
  expect(iconsSpy.occurrences[0].altText).toBe('Office for National Statistics logo');
196
196
  });
197
197
 
198
- it('has the provided masthead logo icon alt text', () => {
199
- const faker = templateFaker();
200
- const iconsSpy = faker.spy('icons');
201
-
202
- faker.renderComponent('header', { ...EXAMPLE_HEADER_BASIC, orgLogoAlt: 'Custom alt text' });
203
-
204
- expect(iconsSpy.occurrences[0].altText).toBe('Custom alt text');
205
- });
206
-
207
- it('has the default masthead mobile logo icon', () => {
198
+ it('has the default masthead mobile logo icon alt text', () => {
208
199
  const faker = templateFaker();
209
200
  const iconsSpy = faker.spy('icons');
210
201
 
211
202
  faker.renderComponent('header', EXAMPLE_HEADER_BASIC);
212
203
 
213
- expect(iconsSpy.occurrences[1].iconType).toBe('ons-logo-stacked-en');
204
+ expect(iconsSpy.occurrences[1].altText).toBe('Office for National Statistics logo');
214
205
  });
215
206
 
216
- it('has the provided masthead mobile logo icon', () => {
217
- const faker = templateFaker();
218
- const iconsSpy = faker.spy('icons');
219
-
220
- faker.renderComponent('header', { ...EXAMPLE_HEADER_BASIC, orgMobileLogo: 'another-mobile-logo' });
207
+ it('has the provided large masthead logo', () => {
208
+ const $ = cheerio.load(
209
+ renderComponent('header', { ...EXAMPLE_HEADER_BASIC, mastheadLogo: { large: '<img src="another-logo.svg">' } }),
210
+ );
221
211
 
222
- expect(iconsSpy.occurrences[1].iconType).toBe('another-mobile-logo');
212
+ expect($('.ons-header__org-logo--large img').attr('src')).toBe('another-logo.svg');
223
213
  });
224
214
 
225
- it('has the default masthead mobile logo icon alt text', () => {
226
- const faker = templateFaker();
227
- const iconsSpy = faker.spy('icons');
228
-
229
- faker.renderComponent('header', EXAMPLE_HEADER_BASIC);
215
+ it('has the provided masthead logo custom classes', () => {
216
+ const $ = cheerio.load(
217
+ renderComponent('header', {
218
+ ...EXAMPLE_HEADER_BASIC,
219
+ mastheadLogo: { large: '<img src="another-logo.svg">', classes: 'custom-class another-custom-class' },
220
+ }),
221
+ );
230
222
 
231
- expect(iconsSpy.occurrences[1].altText).toBe('Office for National Statistics logo');
223
+ expect($('.ons-header__grid-top').hasClass('custom-class')).toBe(true);
224
+ expect($('.ons-header__grid-top').hasClass('another-custom-class')).toBe(true);
232
225
  });
233
226
 
234
- it('has the provided masthead mobile logo icon alt text', () => {
235
- const faker = templateFaker();
236
- const iconsSpy = faker.spy('icons');
237
-
238
- faker.renderComponent('header', { ...EXAMPLE_HEADER_BASIC, orgLogoAlt: 'Custom alt text' });
227
+ it('has the provided small masthead logo', () => {
228
+ const $ = cheerio.load(
229
+ renderComponent('header', {
230
+ ...EXAMPLE_HEADER_BASIC,
231
+ mastheadLogo: { large: 'another-logo.svg', small: '<img src="another-logo-small.svg">' },
232
+ }),
233
+ );
239
234
 
240
- expect(iconsSpy.occurrences[1].altText).toBe('Custom alt text');
235
+ expect($('.ons-header__org-logo--small img').attr('src')).toBe('another-logo-small.svg');
241
236
  });
242
237
 
243
238
  it('displays the `title` text', () => {
@@ -259,59 +254,38 @@ describe('macro: header', () => {
259
254
  });
260
255
 
261
256
  it('has the correct `title` link', () => {
262
- const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_BASIC, titleLogoHref: '#0' }));
257
+ const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_BASIC, titleUrl: '#0' }));
263
258
 
264
259
  expect($('.ons-header__title-link').attr('href')).toBe('#0');
265
260
  });
266
261
 
267
- it('has the provided title logo icon', () => {
268
- const faker = templateFaker();
269
- const iconsSpy = faker.spy('icons');
270
-
271
- faker.renderComponent('header', { ...EXAMPLE_HEADER_BASIC, titleLogo: 'custom-title-logo', titleLogoAlt: 'custom logo alt' });
262
+ it('has the provided large title logo', () => {
263
+ const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_BASIC, titleLogo: { large: '<img src="another-logo.svg">' } }));
272
264
 
273
- expect(iconsSpy.occurrences[2].iconType).toBe('custom-title-logo');
265
+ expect($('.ons-header__title-logo--large img').attr('src')).toBe('another-logo.svg');
274
266
  });
275
267
 
276
- it('has the provided title logo classes', () => {
268
+ it('has the provided title logo custom classes', () => {
277
269
  const $ = cheerio.load(
278
270
  renderComponent('header', {
279
271
  ...EXAMPLE_HEADER_BASIC,
280
- titleLogo: 'custom-title-logo',
281
- titleLogoClasses: 'custom-class',
282
- titleLogoAlt: 'custom logo alt',
272
+ titleLogo: { large: 'another-logo.svg', classes: 'custom-class another-custom-class' },
283
273
  }),
284
274
  );
285
275
 
286
276
  expect($('.ons-header__title-logo--large').hasClass('custom-class')).toBe(true);
277
+ expect($('.ons-header__title-logo--large').hasClass('another-custom-class')).toBe(true);
287
278
  });
288
279
 
289
- it('has the provided title logo mobile icon', () => {
290
- const faker = templateFaker();
291
- const iconsSpy = faker.spy('icons');
292
-
293
- faker.renderComponent('header', {
294
- ...EXAMPLE_HEADER_BASIC,
295
- titleLogo: 'custom-title-logo',
296
- titleLogoMobile: 'custom-title-mobile-logo',
297
- titleLogoAlt: 'custom logo alt',
298
- });
299
-
300
- expect(iconsSpy.occurrences[3].iconType).toBe('custom-title-mobile-logo');
301
- });
302
-
303
- it('has the provided title logo mobile classes', () => {
280
+ it('has the provided small title logo', () => {
304
281
  const $ = cheerio.load(
305
282
  renderComponent('header', {
306
283
  ...EXAMPLE_HEADER_BASIC,
307
- titleLogo: 'custom-title-logo',
308
- titleLogoMobile: 'custom-title-mobile-logo',
309
- titleLogoMobileClasses: 'custom-mobile-class',
310
- titleLogoAlt: 'custom logo alt',
284
+ titleLogo: { large: '<img src="another-logo.svg">', small: '<img src="another-logo-small.svg">' },
311
285
  }),
312
286
  );
313
287
 
314
- expect($('.ons-header__title-logo--mobile').hasClass('custom-mobile-class')).toBe(true);
288
+ expect($('.ons-header__title-logo--small img').attr('src')).toBe('another-logo-small.svg');
315
289
  });
316
290
 
317
291
  it('displays the `description` text', () => {
@@ -653,8 +627,8 @@ describe('macro: header', () => {
653
627
  text: 'Menu',
654
628
  ariaLabel: 'Toggle main menu',
655
629
  },
656
- siteSearchAutosuggest: {},
657
630
  },
631
+ siteSearchAutosuggest: {},
658
632
  });
659
633
 
660
634
  expect(buttonSpy.occurrences[0]).toEqual({
@@ -671,12 +645,4 @@ describe('macro: header', () => {
671
645
  });
672
646
  });
673
647
  });
674
-
675
- describe('mode: without masthead', () => {
676
- it('does not render the masthead', () => {
677
- const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_BASIC, ...EXAMPLE_HEADER_LANGUAGE_CONFIG, noMasthead: true }));
678
-
679
- expect($('.ons-header__top').length).toBe(0);
680
- });
681
- });
682
648
  });
@@ -6,6 +6,10 @@
6
6
  padding: 0;
7
7
  position: relative;
8
8
 
9
+ &--dark {
10
+ background-color: var(--ons-color-hero-bg-dark);
11
+ }
12
+
9
13
  &__container {
10
14
  align-items: center;
11
15
  display: flex;