Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace 'unset' property in printed background colours #4184

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

matthillco
Copy link
Contributor

@matthillco matthillco commented Sep 2, 2024

What

In improving print styles in gem components (#4073), we used background-color: unset to revert backgrounds to transparent for print. This would ensure that inverse components would always print non-inverted, saving ink.

After discussion we decided to change this to use background: none instead, because:

  • the use of unset is uncommon and not well understood, and its behaviour can be unpredictable
  • background: none is a more common accepted approach and easier to understand. We've taken into account that resetting all background properties can be considered a CSS anti-pattern, however we're confident in this case that it won't have any adverse effects because we're not using any other background properties in the affected components.

This PR also makes consistent other treatments of background, such as background-color: transparent or background: initial.

Trello

@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4184 September 2, 2024 08:27 Inactive
@matthillco matthillco force-pushed the fix-background-color-unset branch from 8bfefc6 to e635ea9 Compare September 2, 2024 08:32
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4184 September 2, 2024 08:32 Inactive
@matthillco matthillco requested a review from AshGDS September 2, 2024 08:41
Copy link
Contributor

@AshGDS AshGDS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@matthillco matthillco merged commit 422e139 into main Sep 2, 2024
12 checks passed
@matthillco matthillco deleted the fix-background-color-unset branch September 2, 2024 09:26
@matthillco matthillco mentioned this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants