-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add support for trailing and leading visual icons in Primer::Beta::Link (second try) #3041
base: main
Are you sure you want to change the base?
Conversation
…Primer::Beta::Link (primer#2982)" (primer#3040)" This reverts commit 612307d.
🦋 Changeset detectedLatest commit: cc5c5f3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hi @camertron I addressed your feedback from #3040. I chose however a different approach which I tried to explain above. I would be intereseted in your opinion on this. |
8ee34a8
to
80b0d8b
Compare
… effect to the actual text instead of overflowing into the white space between text and leading/trailing icons
Hi @camertron any news on this? |
Hey folks :) is it possible to get any feedback on this? /cc @camertron |
Hey @HDinger my sincere apologies for letting this lapse for so long 😬 I'll try to follow up more quickly next time! I copied this PR into the primer org so our visual regression tests (VRT) would run, and I'm seeing a number of issues in this PR that I'm hoping can be addressed before merge. Could you take a look at these? https://github.com/primer/view_components/pull/3150/files You should be able to run the VRT tests and generate snapshots locally by running |
Thanks for detailed explanation 🙇 I will have a look in the next days 👍 |
Hi @camertron there was indeed a change in the line-height. Locally the images now look fine. Could you please check here? |
…fix/underline-for-link-icons
…_components into fix/underline-for-link-icons
…, we have to fall back to the browser default "normal" for the line-height instead of using a typography variable
@camertron Done 👍 The semver label run is still red, but I honestly don't know what to do about that |
Yeah, the semver check is running into a permissions issue, we can ignore it. |
Hi @camertron 👋 Is there anything left I can do to get this finished? |
What are you trying to accomplish?
This is a follow-up of #3040. It re-adds the
with_leading_icon
andwith_trailing_icon
slots to Links. The original PR was reverted, because:This is a result of the additional spacing that is added in between inline elements by the browser.
Screenshots
Before
After
List the issues that this change affects.
Closes #2981
What approach did you choose and why?
One possible solution is to render the icons outside the tag itself and set their foreground color to the link color. In my eyes, this approach has two main disadvantages:
I tried out a different approach, which is also not ideal, but still better in my eyes: I added a
span
around the whole content (including the icons) resulting in the following HTML:Thus, I can set
display: inline-flex
on theLink-content
span which omits all additional white spaces that inline elements normally have while leaving the acutal<a>
tag unchanged.Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.