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

[support/4.4.x] Fix focus styles for links split over multiple lines in Chromium 108+ (Chrome 108+, Edge 108+, Opera 94+) #3107

Merged
merged 2 commits into from
Dec 15, 2022

Conversation

36degrees
Copy link
Contributor

⚠️ This PR cherry-picks the changes from #3087 into the support/4.4.x branch so that we can release a fix version of GOV.UK Frontend without other unreleased changes that are on the main branch.


Chromium 108 includes a change in behaviour for box decoration when a box is split over multiple lines, pages etc.

This change in theory brings Chromium in line with the CSS Fragmentation Module Level 3 spec but means that the box-shadow (which we rely on for colour contrast for the focus state) no longer appears on links that break over multiple lines.

This affects browsers based on Chromium 108 including Chrome 108, Edge 108 and Opera 94.

Add box-decoration-break: clone so that box-shadow is applied to each fragment independently, maintaining the existing behaviour in Chromium browsers.

Before

A link with long enough text that it wraps over two lines. The link is focused, and has a yellow background. It is missing a black bottom edge (box-shadow) which is present on single-line links.

After

A link with long enough text that it wraps over two lines. The link is focused, and has a yellow background, and has a black bottom edge (box-shadow) which matches the style used on single-line links.

Fixes #3085.

Chromium 108 includes a change in behaviour for box decoration when a box is split over multiple lines, pages etc [1].

This change in theory brings Chromium in line with the CSS Fragmentation Module Level 3 spec [2] but means that the box-shadow (which we rely on for colour contrast for the focus state) no longer appears on links that break over multiple lines.

This affects browsers based on Chromium 108 including Chrome 108, Edge 108 and Opera 94.

Add `box-decoration-break: clone` so that `box-shadow` is applied to each fragment independently, maintaining the existing behaviour in Chromium browsers.

[1]: https://bugs.chromium.org/p/chromium/issues/detail?id=682173
[2]: https://www.w3.org/TR/css-break-3/#propdef-box-decoration-break

Co-authored-by: Colin Rotherham <work@colinr.com>
@36degrees 36degrees added this to the v4.4.1 milestone Dec 15, 2022
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3107 December 15, 2022 12:07 Inactive
@36degrees 36degrees force-pushed the cherry-pick-chrome-links-fix branch from 5299066 to dc6f98e Compare December 15, 2022 12:07
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3107 December 15, 2022 12:07 Inactive
Copy link
Contributor

@owenatgov owenatgov left a comment

Choose a reason for hiding this comment

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

Does the job

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3107 December 15, 2022 12:11 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3107 December 15, 2022 12:29 Inactive
@36degrees 36degrees merged commit 8cad4bc into support/4.4.x Dec 15, 2022
@36degrees 36degrees deleted the cherry-pick-chrome-links-fix branch December 15, 2022 13:17
@36degrees 36degrees mentioned this pull request Dec 15, 2022
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