Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add summary list row classes #1007

Merged
merged 4 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))

## 8.3.0 - 24 July 2024

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 @@ -10,7 +10,7 @@
{% endmacro -%}
<dl class="nhsuk-summary-list {%- if params.classes %} {{ params.classes }}{% endif %}" {{- nhsukAttributes(params.attributes) }}>
{% for row in params.rows %}
<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
Loading