From 73eb43a979061d21539c43c65ce546272ff5ac03 Mon Sep 17 00:00:00 2001 From: Owen Jones Date: Fri, 12 Jan 2024 14:12:38 +0000 Subject: [PATCH] Add a modifier for complex tables --- .../src/govuk/components/table/_index.scss | 8 ++++++++ .../src/govuk/components/table/table.yaml | 20 ++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/govuk-frontend/src/govuk/components/table/_index.scss b/packages/govuk-frontend/src/govuk/components/table/_index.scss index b331ae7d16..dc600ebafa 100644 --- a/packages/govuk-frontend/src/govuk/components/table/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/table/_index.scss @@ -9,6 +9,14 @@ 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-media-query($until: tablet) { + @include govuk-font-size($size: 16); + } + } + .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