hmrc-frontend 4.8.0 → 5.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.
package/hmrc/VERSION.txt CHANGED
@@ -1 +1 @@
1
- 4.8.0
1
+ 5.0.0
@@ -87,28 +87,28 @@ $hmrc-transition-type: "all";
87
87
 
88
88
  &:hover,
89
89
  &:focus {
90
+ outline: none;
90
91
  border-bottom-width: 4px;
91
92
  border-bottom-style: solid;
92
- color: govuk-colour("light-blue");
93
+ color: $govuk-link-hover-colour;
94
+ border-bottom-color: $govuk-link-hover-colour;
93
95
  }
94
96
 
95
- &:hover {
96
- border-bottom-color: govuk-colour("light-grey");
97
+ &:focus {
98
+ background-color: $govuk-focus-colour;
99
+ color: $govuk-focus-text-colour;
97
100
  }
98
101
 
99
- &:focus {
100
- border-bottom-color: $govuk-focus-colour;
101
- background-color: transparent;
102
+ .hmrc-notification-badge {
103
+ // otherwise the line height is slightly larger than the menu items and we
104
+ // get a small gap under menu items without a notification badge.
105
+ line-height: inherit;
102
106
  }
103
107
  }
104
108
 
105
109
  .is-smaller .hmrc-account-menu__link {
106
110
  padding-left: 10px;
107
111
  color: govuk-colour("black");
108
-
109
- &:hover {
110
- color: govuk-colour("black");
111
- }
112
112
  }
113
113
 
114
114
  .hmrc-account-menu__link--home {
@@ -120,27 +120,6 @@ $hmrc-transition-type: "all";
120
120
  .is-smaller .hmrc-account-menu__link--home,
121
121
  .is-smaller .hmrc-account-menu__link--menu {
122
122
  padding-left: 0;
123
-
124
- &:hover {
125
- border-bottom-color: transparent;
126
- }
127
-
128
- &:focus {
129
- border-bottom-color: $hmrc-account-menu-yellow-1;
130
- color: govuk-colour("light-blue");
131
- }
132
-
133
- &.hmrc-account-menu__link--active {
134
- &:hover {
135
- border-bottom-color: $govuk-brand-colour;
136
- color: govuk-colour("black");
137
- }
138
-
139
- &:focus {
140
- border-bottom-color: $hmrc-account-menu-yellow-1;
141
- color: govuk-colour("light-blue");
142
- }
143
- }
144
123
  }
145
124
 
146
125
  .hmrc-account-menu__link--menu {
@@ -214,6 +193,7 @@ $hmrc-transition-type: "all";
214
193
 
215
194
  .hmrc-account-menu__link {
216
195
  border-bottom: 0;
196
+ display: block;
217
197
 
218
198
  &:hover {
219
199
  border-bottom: 0;
@@ -31,13 +31,11 @@ $govuk-header-link-underline-thickness: 3px;
31
31
  .govuk-list {
32
32
  margin-bottom: 0;
33
33
 
34
- a {
35
- color: govuk-colour("white");
34
+ a:not(.govuk-header__link) {
35
+ @include govuk-font($size: 16, $weight: "bold");
36
36
 
37
- &:not(.govuk-header__link) {
38
- color: govuk-colour("mid-grey");
39
- text-decoration: none;
40
- }
37
+ color: govuk-colour("mid-grey");
38
+ text-decoration: none;
41
39
  }
42
40
  }
43
41
 
@@ -4,22 +4,35 @@
4
4
 
5
5
  .hmrc-list-with-actions {
6
6
  @include govuk-font($size: 19);
7
- }
8
7
 
9
- // Kept for backward compatibility with add-to-a-list
10
- .hmrc-list-with-actions--short {
11
8
  @include govuk-media-query($from: desktop) {
9
+ .hmrc-summary-list__key {
10
+ width: 50%;
11
+ }
12
+
13
+ .hmrc-summary-list__actions {
14
+ width: 50%;
15
+ }
16
+
12
17
  .hmrc-list-with-actions__name {
13
- width: 30%;
18
+ width: 50%;
14
19
  }
15
20
  }
16
21
  }
17
22
 
18
23
  // Kept for backward compatibility with add-to-a-list
19
- .hmrc-list-with-actions--long {
24
+ .hmrc-list-with-actions--short {
20
25
  @include govuk-media-query($from: desktop) {
26
+ .hmrc-summary-list__key {
27
+ width: 30%;
28
+ }
29
+
30
+ .hmrc-summary-list__actions {
31
+ width: 70%;
32
+ }
33
+
21
34
  .hmrc-list-with-actions__name {
22
- width: 50%;
35
+ width: 30%;
23
36
  }
24
37
  }
25
38
  }
@@ -1,33 +1,50 @@
1
1
  {%- macro _actionLink(action) %}
2
2
  <a class="govuk-link {%- if action.classes %} {{ action.classes }}{% endif %}" href="{{ action.href }}" {%- for attribute, value in action.attributes %} {{attribute}}="{{value}}"{% endfor %}>
3
- {% if action.html %}
4
- {{ action.html | safe }}
5
- {% else %}
6
- {%- if action.visuallyHiddenText -%}
7
- <span aria-hidden="true">{{ action.text }}</span>
8
- <span class="govuk-visually-hidden">{{ action.visuallyHiddenText }}</span>
9
- {% else %}
10
- {{ action.text }}
11
- {% endif -%}
12
- {% endif %}
3
+ {%- if action.html -%}
4
+ {{ action.html | safe }}
5
+ {%- else -%}
6
+ {%- if action.visuallyHiddenText -%}
7
+ <span aria-hidden="true">{{ action.text }}</span>{#- strip spaces -#}
8
+ <span class="govuk-visually-hidden">{{ action.visuallyHiddenText }}</span>
9
+ {%- else -%}
10
+ {{ action.text }}
11
+ {%- endif -%}
12
+ {%- endif -%}
13
13
  </a>
14
14
  {% endmacro -%}
15
15
 
16
- {% if params.items.length > 0 %}
17
- <dl class="hmrc-list-with-actions {%- if params.classes %} {{ params.classes }}{% endif %}"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
18
- {% for item in params.items %}
19
- <div class="hmrc-list-with-actions__item">
20
- <dt class="hmrc-list-with-actions__name">
21
- {{ item.name.html | safe if item.name.html else item.name.text }}
22
- </dt>
23
- <div class="hmrc-list-with-actions__actions">
24
- {% for action in item.actions %}
25
- <dd class="hmrc-list-with-actions__action">
26
- {{ _actionLink(action) | indent(6) | trim }}
27
- </dd>
28
- {% endfor %}
29
- </div>
30
- </div>
16
+ {# Determine if we need 2 or 3 columns #}
17
+ {% set anyRowHasActions = false %}
18
+ {% for row in params.items %}
19
+ {% set anyRowHasActions = true if row.actions.length else anyRowHasActions %}
20
+ {% endfor -%}
21
+
22
+ {% if params.items.length %}
23
+ <dl class="govuk-summary-list hmrc-list-with-actions {%- if params.classes %} {{ params.classes }}{% endif %}"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
24
+ {% for row in params.items %}
25
+ {% if row %}
26
+ <div class="govuk-summary-list__row {%- if anyRowHasActions and not row.actions %} govuk-summary-list__row--no-actions{% endif %} {%- if row.classes %} {{ row.classes }}{% endif %}">
27
+ <dt class="govuk-summary-list__key govuk-!-font-weight-regular hmrc-summary-list__key">
28
+ {{ row.name.html | safe if row.name.html else row.name.text }}
29
+ </dt>
30
+ {% if row.actions.length %}
31
+ <dd class="govuk-summary-list__actions hmrc-summary-list__actions">
32
+ {% if row.actions.length == 1 %}
33
+ {{ _actionLink(row.actions[0]) | indent(12) | trim }}
34
+ {% else %}
35
+ <ul class="govuk-summary-list__actions-list">
36
+ {% for action in row.actions %}
37
+ <li class="govuk-summary-list__actions-list-item">
38
+ {{ _actionLink(action) | indent(18) | trim }}
39
+ </li>
40
+ {% endfor %}
41
+ </ul>
42
+ {% endif %}
43
+ </dd>
44
+ {% endif %}
45
+ </div>
46
+ {% endif %}
31
47
  {% endfor %}
32
- </dl>
33
- {% endif -%}
48
+ </dl>
49
+ {% endif %}
50
+
@@ -1,18 +1,21 @@
1
1
  .hmrc-page-heading {
2
2
  display: table;
3
3
  width: 100%;
4
- margin-top: govuk-em(60, 32);
5
- margin-bottom: govuk-em(30, 32);
6
4
  padding-top: 8px;
7
5
  clear: both;
8
6
  table-layout: fixed;
9
7
 
8
+ .hmrc-caption {
9
+ display: table-header-group;
10
+ }
11
+ }
12
+
13
+ .hmrc-page-heading--with-margin {
14
+ margin-top: govuk-em(60, 32);
15
+ margin-bottom: govuk-em(30, 32);
16
+
10
17
  @include govuk-media-query($from: tablet) {
11
18
  margin-top: govuk-em(90, 48);
12
19
  margin-bottom: govuk-em(60, 48);
13
20
  }
14
-
15
- .hmrc-caption-xl {
16
- display: table-header-group;
17
- }
18
21
  }
@@ -1,6 +1,6 @@
1
- <header class="hmrc-page-heading">
2
- <h1 class="govuk-heading-xl">{{ params.text }}</h1>
1
+ <header class="hmrc-page-heading{%- if params.classes %} {{ params.classes }}{%- endif -%}">
2
+ <h1 class="{{ params.headingClasses | default('govuk-heading-xl') }}">{{ params.text }}</h1>
3
3
  {%- if params.section -%}
4
- <p class="govuk-caption-xl hmrc-caption-xl"><span class="govuk-visually-hidden">{% if params.language === 'cy' %}Teitl yr adran hon yw{%else%}This section is{%endif%} </span>{{ params.section }}</p>
4
+ <p class="hmrc-caption {{ params.captionClasses | default('govuk-caption-xl') }}"><span class="govuk-visually-hidden">{% if params.language === 'cy' %}Teitl yr adran hon yw{%else%}This section is{%endif%} </span>{{ params.section }}</p>
5
5
  {%- endif -%}
6
6
  </header>