diff --git a/CHANGELOG.md b/CHANGELOG.md index ae1f2de3af..498be00f85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -125,6 +125,9 @@ ([PR #976](https://github.com/alphagov/govuk-frontend/pull/976)) +- Defend tables against GOV.UK Elements code + ([PR #983](https://github.com/alphagov/govuk-frontend/pull/983)) + - Pull Request Title goes here Description goes here (optional) diff --git a/src/components/table/_table.scss b/src/components/table/_table.scss index e329a254bf..76ef87739d 100644 --- a/src/components/table/_table.scss +++ b/src/components/table/_table.scss @@ -15,16 +15,19 @@ .govuk-table__header { @include govuk-typography-weight-bold; - - padding: govuk-spacing(2) govuk-spacing(4) govuk-spacing(2) 0; - border-bottom: 1px solid $govuk-border-colour; - text-align: left; } + .govuk-table__header, .govuk-table__cell { padding: govuk-spacing(2) govuk-spacing(4) govuk-spacing(2) 0; border-bottom: 1px solid $govuk-border-colour; text-align: left; + // GOV.UK Elements sets the font-size and line-height for all headers and cells + // in tables. + @include govuk-compatibility(govuk_elements) { + font-size: inherit; + line-height: inherit; + } } .govuk-table__cell--numeric {