Skip to content

Commit

Permalink
Add a modifier for complex tables
Browse files Browse the repository at this point in the history
  • Loading branch information
owenatgov committed Feb 13, 2024
1 parent b338c69 commit 73eb43a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
20 changes: 19 additions & 1 deletion packages/govuk-frontend/src/govuk/components/table/table.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73eb43a

Please sign in to comment.