diff --git a/packages/govuk-frontend/src/govuk/components/table/_index.scss b/packages/govuk-frontend/src/govuk/components/table/_index.scss index b331ae7d16..1c3e4051e4 100644 --- a/packages/govuk-frontend/src/govuk/components/table/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/table/_index.scss @@ -9,6 +9,16 @@ border-collapse: collapse; } + // Modifier for tables with a lot of data. Tables with lots of data benefit + // from a smaller font size on small screens. + .govuk-table--small-text-until-tablet { + @include govuk-font-size($size: 16); + + @include govuk-media-query($from: tablet) { + @include govuk-font-size($size: 19); + } + } + .govuk-table__header { @include govuk-typography-weight-bold; } diff --git a/packages/govuk-frontend/src/govuk/components/table/table.yaml b/packages/govuk-frontend/src/govuk/components/table/table.yaml index 3121807ecb..52cb6fee5e 100644 --- a/packages/govuk-frontend/src/govuk/components/table/table.yaml +++ b/packages/govuk-frontend/src/govuk/components/table/table.yaml @@ -156,7 +156,25 @@ examples: format: numeric - text: £125 format: numeric - + - name: with small text modifier for tables with a lot of data + options: + classes: govuk-table--small-text-until-tablet + rows: + - - text: January + - text: £85 + format: numeric + - text: £95 + format: numeric + - - text: February + - text: £75 + format: numeric + - text: £55 + format: numeric + - - text: March + - text: £165 + format: numeric + - text: £125 + format: numeric # Hidden examples are not shown in the review app, but are used for tests and HTML fixtures - name: classes hidden: true