Skip to content

Commit

Permalink
Add summary list row classes (#1007)
Browse files Browse the repository at this point in the history
This adds support for custom classes on summary list rows.
  • Loading branch information
frankieroberto authored Sep 10, 2024
1 parent 5e44a2e commit 09aba75
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fix Sass deprecation on `mix` function (passing a number without unit) ([PR 995](https://github.com/nhsuk/nhsuk-frontend/pull/995))
- Add nhsukAttributes macro, copied from GOV.UK ([PR 998](https://github.com/nhsuk/nhsuk-frontend/pull/998))
- Fix missing classes option for summary list rows ([PR 1007](https://github.com/nhsuk/nhsuk-frontend/pull/1007))
- Add support for inline conditions on summary list rows ([PR 1008](https://github.com/nhsuk/nhsuk-frontend/pull/1008))
- Change "Contact us" in the footer link examples to "Give us feedback" ([PR 972](https://github.com/nhsuk/nhsuk-frontend/pull/972))
- Adjusted default spacing of back link component ([PR 964](https://github.com/nhsuk/nhsuk-frontend/pull/964))
Expand Down
1 change: 1 addition & 0 deletions packages/components/summary-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ The summary list Nunjucks macro takes the following arguments:
| classes | string | No | Classes to add to the container. |
| attributes | object | No | HTML attributes (for example data attributes) to add to the container. |
| rows | array | Yes | Array of row item objects. |
| rows.classes | string | No | Classes to add to the row wrapper. |
| rows.key.text | string | Yes | If html is set, this is not required. Text to use within the each key. If html is provided, the text argument will be ignored. |
| rows.key.html | string | Yes | |
| rows.key.classes | string | No | Classes to add to the key wrapper. |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/summary-list/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<dl class="nhsuk-summary-list {%- if params.classes %} {{ params.classes }}{% endif %}" {{- nhsukAttributes(params.attributes) }}>
{% for row in params.rows %}
{% if row %}
<div class="nhsuk-summary-list__row">
<div class="nhsuk-summary-list__row {%- if row.classes %} {{ row.classes }}{% endif %}">
<dt class="nhsuk-summary-list__key {%- if row.key.classes %} {{ row.key.classes }}{% endif %}">
{{ row.key.html | safe if row.key.html else row.key.text }}
</dt>
Expand Down

0 comments on commit 09aba75

Please sign in to comment.