diff --git a/CHANGELOG.md b/CHANGELOG.md
index 22aa84d1fb..a12d056ca2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,7 @@ Breaking changes:
update it to reference the new variable $govuk-is-ie8 – see the README for
details.
(PR [#631](https://github.com/alphagov/govuk-frontend/pull/631))
+- Rename captionSize table argument to captionClasses ([PR #643](https://github.com/alphagov/govuk-frontend/pull/643))
Fixes:
- Link styles, as well as links within the back-link, breadcrumbs, button,
diff --git a/src/table/README.md b/src/table/README.md
index d489ca503d..31c63a9448 100644
--- a/src/table/README.md
+++ b/src/table/README.md
@@ -225,7 +225,7 @@ Find out when to use the Table component in your service in the [GOV.UK Design S
- Caption 1 : Months and rates
+ Caption 1 : Months and rates
@@ -280,7 +280,7 @@ Find out when to use the Table component in your service in the [GOV.UK Design S
{{ govukTable({
"caption": "Caption 1 : Months and rates",
- "captionSize": "govuk-heading-l",
+ "captionClasses": "govuk-heading-m",
"firstCellIsHeader": true,
"head": [
{
@@ -412,13 +412,13 @@ If you are using Nunjucks,then macros take the following arguments
-
+
string |
No |
-Optional caption text size. Class should correspond to the available heading classes. |
+Optional classes for caption text size. Class should correspond to the available typography heading classes. |
diff --git a/src/table/index.njk b/src/table/index.njk
index bac0132301..ca5ae36900 100644
--- a/src/table/index.njk
+++ b/src/table/index.njk
@@ -67,7 +67,7 @@
],
[
{
- text: 'captionSize'
+ text: 'captionClasses'
},
{
text: 'string'
@@ -76,7 +76,7 @@
text: 'No'
},
{
- text: 'Optional caption text size. Class should correspond to the available heading classes.'
+ text: 'Optional classes for caption text size. Class should correspond to the available typography heading classes.'
}
],
[
diff --git a/src/table/table.yaml b/src/table/table.yaml
index 5c03ac8f10..d3e0be5f93 100644
--- a/src/table/table.yaml
+++ b/src/table/table.yaml
@@ -50,7 +50,7 @@ examples:
- name: table-with-caption-and-head
data:
caption: "Caption 1 : Months and rates"
- captionSize: govuk-heading-l
+ captionClasses: govuk-heading-m
firstCellIsHeader: true
head:
- text: Month you apply
diff --git a/src/table/template.njk b/src/table/template.njk
index 0ebaa98b5d..777a3e2fd4 100644
--- a/src/table/template.njk
+++ b/src/table/template.njk
@@ -2,7 +2,7 @@
{%- if params.classes %} {{ params.classes }}{% endif %}"{% for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
{% if params.caption %}
{{ params.caption }}
+ {%- if params.captionClasses %} {{ params.captionClasses }}{% endif %}">{{ params.caption }}
{% endif %}
{% if params.head %}
diff --git a/src/table/template.test.js b/src/table/template.test.js
index a9884417c4..9964f08a43 100644
--- a/src/table/template.test.js
+++ b/src/table/template.test.js
@@ -54,7 +54,7 @@ describe('Table', () => {
const $ = render('table', examples['table-with-caption-and-head'])
const $caption = $('.govuk-c-table__caption')
- expect($caption.hasClass('govuk-heading-l')).toBeTruthy()
+ expect($caption.hasClass('govuk-heading-m')).toBeTruthy()
})
it('renders first cell in every row as a element with correct `govuk-c-table__header` class and `scope=row` attribute', () => {
|