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

fix(Anchor): use text-decoration instead of box-shadow for chromium breaking underline support #1841

Merged
merged 3 commits into from
Dec 21, 2022

Conversation

tujoworker
Copy link
Member

@tujoworker tujoworker commented Dec 20, 2022

Chromium based browser have no longer support for Anchor underline based on box-shadow. At least when I test it.

Screenshot 2022-12-21 at 06 21 20

That said, we can still support it (with inset and negative offset), but the underline offset is then not enough by 1 or 2px.

Screenshot 2022-12-21 at 06 22 25

vs

Screenshot 2022-12-21 at 06 23 20

But now that we do not need to support IE anymore, we can make use of newer CSS properties, like:

  • text-decoration-color
  • text-decoration-thickness
  • text-underline-offset

Out puppeteer chromium version does not support thickness from what I can see, so it is 1px thick:

Screenshot 2022-12-20 at 20 29 12

I'm not 100% sure if we should release this in v10 or v9 as per now. But I think, it should be ok in v9 as well.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 20, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a0f07ea:

Sandbox Source
eufemia-starter Configuration

@gatsby-cloud
Copy link

gatsby-cloud bot commented Dec 20, 2022

✅ DNB Eufemia Portal deploy preview ready

@tujoworker tujoworker changed the title fix(Anchor): use text-decoration instead of box-shadow for chromium breaking lines support fix(Anchor): use text-decoration instead of box-shadow for chromium breaking underline support Dec 21, 2022
@tujoworker tujoworker requested a review from langz December 21, 2022 06:44
Copy link
Contributor

@langz langz left a comment

Choose a reason for hiding this comment

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

Looks great 👍

One observation/thought is that the "alignment" of the letters/line following the "line break" is a bit further to the left than the 1st/"starting line". Not sure if it should be like this or not 🤔.
This was in Chrome using the Deploy preview:

Screenshot 2022-12-21 at 09 17 13

@tujoworker
Copy link
Member Author

Yeah, this is because of the tiny padding (left&right). UX wants even more. We should check if we can remove it entirely.

@tujoworker tujoworker merged commit eba73da into main Dec 21, 2022
@tujoworker tujoworker deleted the fix/anchor-underline branch December 21, 2022 10:33
tujoworker pushed a commit that referenced this pull request Dec 21, 2022
# [9.45.0](v9.44.0...v9.45.0) (2022-12-21)

### Bug Fixes

* **Anchor:** use text-decoration instead of box-shadow for chromium breaking underline support ([#1841](#1841)) ([eba73da](eba73da))

### Features

* **Spacing:** add calc helper ([#1845](#1845)) ([0e7f99e](0e7f99e))
@tujoworker
Copy link
Member Author

🎉 This PR is included in version 9.45.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

joakbjerk pushed a commit that referenced this pull request Mar 27, 2023
…reaking underline support (#1841)

* fix(Anchor): use text-decoration instead of box-shadow for chromium breaking lines support

* Update snapshots

* Update snapshots additional snapshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants