@ons/design-system 72.10.5 → 72.10.6

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 (32) hide show
  1. package/components/button/_button.scss +8 -6
  2. package/components/chart/_macro.njk +15 -3
  3. package/components/chart/_macro.spec.js +163 -1
  4. package/components/chart/example-area-chart-with-axis-min-and-max-values.njk +72 -0
  5. package/components/chart/example-bar-chart-with-axis-min-and-max-values.njk +59 -0
  6. package/components/chart/example-column-chart-with-axis-min-and-max-values.njk +59 -0
  7. package/components/chart/example-line-chart-with-axis-min-and-max-values.njk +227 -0
  8. package/components/chart/example-scatter-chart-with-axis-min-and-max-values.njk +98 -0
  9. package/components/chart/specific-chart-options.js +19 -0
  10. package/components/details-panel/_details-panel.scss +4 -0
  11. package/components/details-panel/_macro.njk +17 -13
  12. package/components/details-panel/_macro.spec.js +17 -0
  13. package/components/details-panel/example-details-panel-open.njk +2 -1
  14. package/components/details-panel/example-details-panel.njk +2 -1
  15. package/components/header/_header.scss +40 -24
  16. package/components/header/_macro.njk +103 -89
  17. package/components/header/_macro.spec.js +130 -2
  18. package/components/header/example-header-basic-with-search-and-language.njk +207 -0
  19. package/components/header/{example-header-with-search-button.njk → example-header-basic-with-search-button.njk} +1 -0
  20. package/components/header/example-header-basic.njk +1 -0
  21. package/components/hero/_macro.njk +9 -2
  22. package/components/hero/_macro.spec.js +22 -0
  23. package/components/hero/example-hero-grey.njk +2 -1
  24. package/components/language-selector/_macro.njk +1 -1
  25. package/components/language-selector/_macro.spec.js +45 -0
  26. package/components/navigation/navigation.js +24 -17
  27. package/components/pagination/_macro.njk +17 -7
  28. package/components/pagination/_macro.spec.js +191 -17
  29. package/css/main.css +1 -1
  30. package/package.json +1 -1
  31. package/scripts/main.es5.js +1 -1
  32. package/scripts/main.js +1 -1
@@ -0,0 +1,227 @@
1
+ {% from "components/chart/_macro.njk" import onsChart %}
2
+
3
+ {{
4
+ onsChart({
5
+ "chartType": "line",
6
+ "description": "Line chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
7
+ "theme": "alternate",
8
+ "title": "Sales volumes and values saw moderate growth in July 2024",
9
+ "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
+ "id": "id",
11
+ "headingLevel": 4,
12
+ "caption": "Source: Monthly Business Survey, Retails Sales Inquiry from the Office for National Statistics",
13
+ "download": {
14
+ 'title': 'Download Figure 1 data',
15
+ 'itemsList': [
16
+ {
17
+ "text": "Excel spreadsheet (XLSX format, 18KB)",
18
+ "url": "#"
19
+ },
20
+ {
21
+ "text": "Simple text file (CSV format, 25KB)",
22
+ "url": "#"
23
+ },
24
+ {
25
+
26
+ "text": "Image (PNG format, 25KB)",
27
+ "url": "#"
28
+ }
29
+ ]},
30
+ "legend": true,
31
+ "xAxis": {
32
+ "title": "Year",
33
+ "type": "linear",
34
+ "labelFormat": "{value:,.f}",
35
+ "categories": [
36
+ 'Oct 2014',
37
+ 'Nov 2014',
38
+ 'Dec 2014',
39
+ 'Jan 2015',
40
+ 'Feb 2015',
41
+ 'Mar 2015',
42
+ 'Apr 2015',
43
+ 'May 2015',
44
+ 'Jun 2015',
45
+ 'Jul 2015',
46
+ 'Aug 2015',
47
+ 'Sep 2015',
48
+ 'Oct 2015',
49
+ 'Nov 2015',
50
+ 'Dec 2015',
51
+ 'Jan 2016',
52
+ 'Feb 2016',
53
+ 'Mar 2016',
54
+ 'Apr 2016',
55
+ 'May 2016',
56
+ 'Jun 2016',
57
+ 'Jul 2016',
58
+ 'Aug 2016',
59
+ 'Sep 2016',
60
+ 'Oct 2016',
61
+ 'Nov 2016',
62
+ 'Dec 2016',
63
+ 'Jan 2017',
64
+ 'Feb 2017',
65
+ 'Mar 2017',
66
+ 'Apr 2017',
67
+ 'May 2017',
68
+ 'Jun 2017',
69
+ 'Jul 2017',
70
+ 'Aug 2017',
71
+ 'Sep 2017',
72
+ 'Oct 2017',
73
+ 'Nov 2017',
74
+ 'Dec 2017',
75
+ 'Jan 2018',
76
+ 'Feb 2018',
77
+ 'Mar 2018',
78
+ 'Apr 2018',
79
+ 'May 2018',
80
+ 'Jun 2018',
81
+ 'Jul 2018',
82
+ 'Aug 2018',
83
+ 'Sep 2018',
84
+ 'Oct 2018',
85
+ 'Nov 2018',
86
+ 'Dec 2018',
87
+ 'Jan 2019',
88
+ 'Feb 2019',
89
+ 'Mar 2019',
90
+ 'Apr 2019',
91
+ 'May 2019',
92
+ 'Jun 2019',
93
+ 'Jul 2019',
94
+ 'Aug 2019',
95
+ 'Sep 2019',
96
+ 'Oct 2019',
97
+ 'Nov 2019',
98
+ 'Dec 2019',
99
+ 'Jan 2020',
100
+ 'Feb 2020',
101
+ 'Mar 2020',
102
+ 'Apr 2020',
103
+ 'May 2020',
104
+ 'Jun 2020',
105
+ 'Jul 2020',
106
+ 'Aug 2020',
107
+ 'Sep 2020',
108
+ 'Oct 2020',
109
+ 'Nov 2020',
110
+ 'Dec 2020',
111
+ 'Jan 2021',
112
+ 'Feb 2021',
113
+ 'Mar 2021',
114
+ 'Apr 2021',
115
+ 'May 2021',
116
+ 'Jun 2021',
117
+ 'Jul 2021',
118
+ 'Aug 2021',
119
+ 'Sep 2021',
120
+ 'Oct 2021',
121
+ 'Nov 2021',
122
+ 'Dec 2021',
123
+ 'Jan 2022',
124
+ 'Feb 2022',
125
+ 'Mar 2022',
126
+ 'Apr 2022',
127
+ 'May 2022',
128
+ 'Jun 2022',
129
+ 'Jul 2022',
130
+ 'Aug 2022',
131
+ 'Sep 2022',
132
+ 'Oct 2022',
133
+ 'Nov 2022',
134
+ 'Dec 2022',
135
+ 'Jan 2023',
136
+ 'Feb 2023',
137
+ 'Mar 2023',
138
+ 'Apr 2023',
139
+ 'May 2023',
140
+ 'Jun 2023',
141
+ 'Jul 2023',
142
+ 'Aug 2023',
143
+ 'Sep 2023',
144
+ 'Oct 2023',
145
+ 'Nov 2023',
146
+ 'Dec 2023',
147
+ 'Jan 2024',
148
+ 'Feb 2024',
149
+ 'Mar 2024',
150
+ 'Apr 2024',
151
+ 'May 2024',
152
+ 'Jun 2024',
153
+ 'Jul 2024',
154
+ 'Aug 2024',
155
+ 'Sep 2024',
156
+ 'Oct 2024'
157
+ ],
158
+ "tickIntervalDesktop": 15,
159
+ "tickIntervalMobile": 30
160
+ },
161
+ "yAxis": {
162
+ "title": "Sales",
163
+ "labelFormat": "{value:,.f}",
164
+ "min": -5,
165
+ "max": 15,
166
+ "startOnTick": true,
167
+ "endOnTick": true
168
+ },
169
+ "series": [
170
+ {
171
+ "name": 'CPIH',
172
+ "data": [
173
+ 1.3, 1.1, 0.7, 0.5, 0.4, 0.3, 0.3, 0.4, 0.3, 0.5, 0.4, 0.2, 0.2, 0.4, 0.5, 0.6,
174
+ 0.6, 0.8, 0.7, 0.7, 0.8, 0.9, 1.0, 1.3, 1.3, 1.5, 1.8, 1.9, 2.3, 2.3, 2.6, 2.7,
175
+ 2.6, 2.6, 2.7, 2.8, 2.8, 2.8, 2.7, 2.7, 2.5, 2.3, 2.2, 2.3, 2.3, 2.3, 2.4, 2.2,
176
+ 2.2, 2.2, 2.0, 1.8, 1.8, 1.8, 2.0, 1.9, 1.9, 2.0, 1.7, 1.7, 1.5, 1.5, 1.4, 1.8,
177
+ 1.7, 1.5, 0.9, 0.7, 0.8, 1.1, 0.5, 0.7, 0.9, 0.6, 0.8, 0.9, 0.7, 1.0, 1.6, 2.1,
178
+ 2.4, 2.1, 3.0, 2.9, 3.8, 4.6, 4.8, 4.9, 5.5, 6.2, 7.8, 7.9, 8.2, 8.8, 8.6, 8.8,
179
+ 9.6, 9.3, 9.2, 8.8, 9.2, 8.9, 7.8, 7.9, 7.3, 6.4, 6.3, 6.3, 4.7, 4.2, 4.2, 4.2,
180
+ 3.8, 3.8, 3.0, 2.8, 2.8, 3.1, 3.1, 2.6, 3.2
181
+ ]
182
+ },
183
+ {
184
+ "name": 'Goods',
185
+ "data": [
186
+ 0.3, -0.2, -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entageHeightDesktop": 35,
225
+ "percentageHeightMobile": 90
226
+ })
227
+ }}
@@ -0,0 +1,98 @@
1
+ {% from "components/chart/_macro.njk" import onsChart %}
2
+
3
+ {{
4
+ onsChart({
5
+ "chartType": "scatter",
6
+ "description": "Example scatter chart",
7
+ "theme": "alternate",
8
+ "title": "Example scatter chart",
9
+ "subtitle": "Scatter chart subtitle",
10
+ "id": "id",
11
+ "headingLevel": 4,
12
+ "caption": "Source: Monthly Business Survey, Retails Sales Inquiry from the Office for National Statistics",
13
+ "download": {
14
+ 'title': 'Download Figure 1 data',
15
+ 'itemsList': [
16
+ {
17
+ "text": "Excel spreadsheet (XLSX format, 18KB)",
18
+ "url": "#"
19
+ },
20
+ {
21
+ "text": "Simple text file (CSV format, 25KB)",
22
+ "url": "#"
23
+ },
24
+ {
25
+
26
+ "text": "Image (PNG format, 25KB)",
27
+ "url": "#"
28
+ }
29
+ ]},
30
+ "xAxis": {
31
+ "title": "Height",
32
+ "min": 155,
33
+ "max": 195,
34
+ "startOnTick": true,
35
+ "endOnTick": true
36
+ },
37
+ "yAxis": {
38
+ "title": "Weight",
39
+ "min": 40,
40
+ "max": 90,
41
+ "startOnTick": true,
42
+ "endOnTick": true
43
+ },
44
+ "legend": true,
45
+ "series": [
46
+ {
47
+ "name": "Female",
48
+ "data": [
49
+ [161.2, 51.6], [167.5, 59.0], [159.5, 49.2], [157.0, 63.0],
50
+ [163.8, 54.5], [158.4, 50.8], [165.2, 57.3], [160.7, 52.4],
51
+ [162.3, 55.1], [166.8, 58.7], [159.8, 51.9], [164.5, 56.2],
52
+ [158.9, 50.3], [163.1, 53.8],
53
+ [161.8, 52.1], [167.1, 58.8], [159.2, 49.8], [157.4, 62.7],
54
+ [163.5, 54.9], [158.7, 51.2], [165.5, 57.8], [160.4, 52.7],
55
+ [162.7, 55.4], [166.4, 58.4], [159.4, 51.5], [164.8, 56.5],
56
+ [158.6, 50.6], [163.4, 53.5]
57
+ ]
58
+ },
59
+ {
60
+ "name": "Male",
61
+ "data": [
62
+ [174.0, 65.6], [175.3, 71.8], [187.5, 80.7], [186.5, 72.6],
63
+ [178.2, 68.4], [182.7, 74.3], [176.8, 67.9], [188.4, 77.2],
64
+ [184.5, 73.8], [179.6, 70.5], [186.2, 79.4], [183.8, 75.1],
65
+ [177.4, 69.2], [185.9, 76.3],
66
+ [174.3, 66.1], [175.8, 71.4], [187.8, 80.2], [186.1, 72.9],
67
+ [178.7, 68.8], [182.2, 74.7], [176.4, 67.5], [188.0, 77.6],
68
+ [184.1, 73.4], [179.2, 70.8], [186.6, 79.8], [183.4, 75.4],
69
+ [177.8, 69.6], [185.5, 76.7]
70
+ ]
71
+ },
72
+ {
73
+ "name": "Adolescent Male",
74
+ "data": [
75
+ [168.5, 58.2], [171.2, 62.4], [169.8, 59.7], [173.4, 63.8],
76
+ [170.6, 61.2], [172.8, 64.5], [167.9, 57.8], [174.2, 65.1],
77
+ [169.5, 60.3], [171.8, 63.2],
78
+ [168.8, 58.6], [171.5, 62.8], [169.2, 59.4], [173.7, 63.5],
79
+ [170.2, 61.6], [172.4, 64.2], [168.2, 58.1], [173.9, 64.8],
80
+ [169.8, 60.7], [171.4, 63.6]
81
+ ]
82
+ },
83
+ {
84
+ "name": "Adolescent Female",
85
+ "data": [
86
+ [164.2, 54.8], [166.5, 57.2], [163.8, 53.9], [165.7, 56.4],
87
+ [162.9, 52.8], [167.2, 58.1], [164.8, 55.3], [166.9, 57.8],
88
+ [163.5, 53.4], [165.4, 56.7],
89
+ [164.5, 55.1], [166.2, 57.5], [163.4, 53.6], [165.9, 56.2],
90
+ [162.6, 52.5], [167.5, 58.4], [164.4, 55.6], [166.6, 57.6],
91
+ [163.8, 53.7], [165.2, 56.9]
92
+ ]
93
+ }
94
+ ],
95
+ "percentageHeightDesktop": 35,
96
+ "percentageHeightMobile": 90
97
+ })
98
+ }}
@@ -15,9 +15,28 @@ class SpecificChartOptions {
15
15
  },
16
16
  yAxis: {
17
17
  tickInterval: yAxisTickInterval,
18
+ // Configure the minimum and maximum value shown on the y-axis.
19
+ // If not set in the config, it is set to undefined which is Highcharts default value.
20
+ min: this.config.yAxis?.min ?? undefined,
21
+ max: this.config.yAxis?.max ?? undefined,
22
+
23
+ // Controls whether the y-axis starts and/or ends exactly on a tick mark.
24
+ // Highcharts defaults to `true` for both startOnTick and endOnTick on y-axes.
25
+ startOnTick: this.config.yAxis?.startOnTick ?? true,
26
+ endOnTick: this.config.yAxis?.endOnTick ?? true,
18
27
  },
28
+
19
29
  xAxis: {
20
30
  tickInterval: xAxisTickInterval,
31
+ // Configure the minimum and maximum value shown on the x-axis.
32
+ // If not set in the config, it is set to undefined which is Highcharts default value.
33
+ min: this.config.xAxis?.min ?? undefined,
34
+ max: this.config.xAxis?.max ?? undefined,
35
+
36
+ // Controls whether the x-axis starts and/or ends exactly on a tick mark.
37
+ // Highcharts defaults to `false` for both startOnTick and endOnTick on x-axes.
38
+ startOnTick: this.config.xAxis?.startOnTick ?? false,
39
+ endOnTick: this.config.xAxis?.endOnTick ?? false,
21
40
  },
22
41
  };
23
42
  }
@@ -124,4 +124,8 @@
124
124
  &__content-heading {
125
125
  color: var(--ons-color-black);
126
126
  }
127
+
128
+ &__content-description {
129
+ margin-left: 0;
130
+ }
127
131
  }
@@ -4,15 +4,15 @@
4
4
 
5
5
  <details class="ons-details-panel" {% if params.open %}{{ ' ' }}data-open{% endif %}>
6
6
  <summary class="ons-details-panel__banner ons-u-pt-s ons-u-pb-s">
7
- <div class="ons-container ons-details-panel__banner-contents">
7
+ <span class="ons-container ons-details-panel__banner-contents">
8
8
  <span class="ons-details-panel__info-icon ons-u-mr-2xs" aria-hidden="true">i</span>
9
- <div class="ons-details-panel__banner-body">
9
+ <span class="ons-details-panel__banner-body">
10
10
  {% set titleTag = params.headingLevel | default(2) %}
11
11
  {% set openingTag = "<h" ~ titleTag %}
12
12
  {% set closingTag = "</h" ~ titleTag ~ ">" %}
13
13
  {{ openingTag | safe }}
14
14
  class="ons-details-panel__banner-title ons-u-fs-m ons-u-mb-2xs">{{ params.title }}{{ closingTag | safe }}
15
- <div class="ons-details-panel__banner-detail">
15
+ <span class="ons-details-panel__banner-detail">
16
16
  <span class="ons-details-panel__banner-detail-title ons-u-mr-3xs">
17
17
  <span class="ons-details-panel__banner-detail-title--open"> {{ openText }} </span>
18
18
  <span class="ons-details-panel__banner-detail-title--close"> {{ closeText }} </span>
@@ -25,27 +25,31 @@
25
25
  })
26
26
  }}
27
27
  </span>
28
- </div>
29
- </div>
30
- </div>
28
+ </span>
29
+ </span>
30
+ </span>
31
31
  </summary>
32
- <div class="ons-container ons-details-panel__content ons-u-pt-xl ons-u-pb-3xl">
32
+ <dl class="ons-container ons-details-panel__content ons-u-pt-xl ons-u-pb-3xl">
33
33
  {% for item in params.detailsItems %}
34
34
  <div class="ons-details-panel__item ons-u-pb-xl ons-u-mb-l ons-u-ml-2xs">
35
- <div class="ons-details-panel__content-meta ons-u-mb-l@2xs@m">
35
+ <dt class="ons-details-panel__content-meta ons-u-mb-l@2xs@m">
36
36
  <h3 class="ons-details-panel__content-heading ons-u-fs-r--b ons-u-mb-no">{{ item.text }}</h3>
37
37
  <time class="ons-details-panel__content-date" datetime="{{ item.date.iso }}">{{ item.date.short }}</time>
38
- </div>
39
- <div class="ons-details-panel__content-description">
38
+ </dt>
39
+ <dd class="ons-details-panel__content-description">
40
40
  <div class="ons-details-panel__content-text ons-u-mb-s">{{ item.description | safe }}</div>
41
41
  {% if item.url or item.text == 'Content' %}
42
- <a class="ons-details-panel__content-url" href="{{ item.url }}">
42
+ <a
43
+ class="ons-details-panel__content-url"
44
+ href="{{ item.url }}"
45
+ {% if item.urlAriaLabel %}aria-label="{{ item.urlAriaLabel }}"{% endif %}
46
+ >
43
47
  {{ item.urlText | default("View superseded version") }}
44
48
  </a>
45
49
  {% endif %}
46
- </div>
50
+ </dd>
47
51
  </div>
48
52
  {% endfor %}
49
- </div>
53
+ </dl>
50
54
  </details>
51
55
  {% endmacro %}
@@ -71,6 +71,23 @@ describe('FOR: Macro: Details Panel', () => {
71
71
  expect(correctionLinkText).toBe('View superseded version');
72
72
  expect(correctionLinkUrl).toBe('#0');
73
73
  });
74
+ test('THEN: item with urlAriaLabel has custom aria label', () => {
75
+ const customParams = {
76
+ ...EXAMPLE_DETAILS_PANEL,
77
+ detailsItems: [
78
+ {
79
+ ...EXAMPLE_DETAILS_PANEL.detailsItems[0],
80
+ urlAriaLabel: 'View superseded version from January 2025',
81
+ },
82
+ ...EXAMPLE_DETAILS_PANEL.detailsItems.slice(1),
83
+ ],
84
+ };
85
+ const $ = cheerio.load(renderComponent('details-panel', customParams));
86
+ const linkWithAriaLabel = $('.ons-details-panel__content-url').eq(0);
87
+
88
+ expect(linkWithAriaLabel.attr('aria-label')).toBe('View superseded version from January 2025');
89
+ expect(linkWithAriaLabel.text().trim()).toBe('View superseded version');
90
+ });
74
91
  });
75
92
  });
76
93
  });
@@ -13,7 +13,8 @@
13
13
  },
14
14
  "description": '<p>The Non-Financial Business Economy publication uses estimates from the Annual Business Survey (ABS). A weighting error means these data have now been revised, with the overall impact being minimal.</p>
15
15
  <p>ONS apologises for any inconvenience caused.</p>',
16
- "url": '#0'
16
+ "url": '#0',
17
+ "urlAriaLabel": 'View superseded version of this publication'
17
18
  },
18
19
  {
19
20
  "text": 'Notice',
@@ -13,7 +13,8 @@
13
13
  },
14
14
  "description": '<p>The Non-Financial Business Economy publication uses estimates from the Annual Business Survey (ABS). A weighting error means these data have now been revised, with the overall impact being minimal.</p>
15
15
  <p>ONS apologises for any inconvenience caused.</p>',
16
- "url": '#0'
16
+ "url": '#0',
17
+ "urlAriaLabel": 'View superseded version of this publication'
17
18
  },
18
19
  {
19
20
  "text": 'Notice',
@@ -65,6 +65,15 @@
65
65
  margin: 0 0 1rem;
66
66
  }
67
67
  }
68
+
69
+ &__language {
70
+ display: none;
71
+
72
+ .ons-js-enabled & {
73
+ display: block;
74
+ }
75
+ }
76
+
68
77
  // Modifier - variants
69
78
  &--description {
70
79
  .ons-header {
@@ -169,13 +178,13 @@
169
178
  }
170
179
 
171
180
  &__org-logo--large {
172
- @include mq('2xs', 460px) {
181
+ @include mq('2xs', 590px) {
173
182
  display: none;
174
183
  }
175
184
  }
176
185
 
177
186
  &__org-logo--small {
178
- @include mq(461px) {
187
+ @include mq(591px) {
179
188
  display: none;
180
189
  }
181
190
  }
@@ -245,6 +254,16 @@
245
254
 
246
255
  #{$root}__menu-links {
247
256
  width: 100%;
257
+
258
+ #{$root}__language {
259
+ display: block;
260
+ padding-top: 1rem;
261
+
262
+ // hide the language switcher within nav when js is enabled
263
+ .ons-js-enabled & {
264
+ display: none;
265
+ }
266
+ }
248
267
  }
249
268
 
250
269
  // When JS is enabled, revert the no-js styles
@@ -260,26 +279,11 @@
260
279
  }
261
280
 
262
281
  &-nav-menu {
263
- // applies styles for non-js variant
264
- background-color: var(--ons-color-branded-tint);
265
- border-bottom: 1px solid var(--ons-color-ocean-blue);
266
282
  margin-bottom: 0;
267
- padding-bottom: 1rem;
283
+ padding-bottom: 2.5rem;
268
284
  position: relative;
269
285
  width: 100%;
270
286
 
271
- // updates styles when js is enabled
272
- .ons-js-enabled & {
273
- border-bottom: 0;
274
- margin-bottom: 1rem;
275
- padding-bottom: 0;
276
- position: absolute;
277
- top: 100%;
278
- left: 50%;
279
- width: 100vw;
280
- transform: translateX(-50%);
281
- }
282
-
283
287
  &__key-list {
284
288
  border-bottom: 1px solid var(--ons-color-ocean-blue);
285
289
  margin-bottom: 1.25rem;
@@ -312,14 +316,14 @@
312
316
  }
313
317
  }
314
318
 
319
+ // applies styles for non-js variant
320
+ &-nav-menu ~ &-nav-search {
321
+ border-top: 1px solid var(--ons-color-ocean-blue);
322
+ }
323
+
324
+ &-nav-menu,
315
325
  &-nav-search {
316
326
  background-color: var(--ons-color-branded-tint);
317
- margin-bottom: 1rem;
318
- @extend .ons-u-pt-2xl;
319
- @extend .ons-u-pb-2xl;
320
-
321
- position: relative;
322
- width: 100%;
323
327
 
324
328
  // updates styles when js is enabled
325
329
  .ons-js-enabled & {
@@ -328,7 +332,19 @@
328
332
  left: 50%;
329
333
  width: 100vw;
330
334
  transform: translateX(-50%);
335
+ border-top: 0;
336
+ z-index: 500;
331
337
  }
338
+ }
339
+
340
+ &__menu-links ~ &__links {
341
+ padding-bottom: 0.25rem;
342
+ }
343
+
344
+ &-nav-search {
345
+ @extend .ons-u-pt-2xl;
346
+ @extend .ons-u-pb-2xl;
347
+
332
348
  &__input {
333
349
  border-bottom: 1px solid var(--ons-color-ocean-blue);
334
350
  @extend .ons-u-mb-2xl;