fix(external-link): adjust positioning of the icon - #1870
Conversation
|
56cdf09 was deployed to: https://fred-pr1870.review.mdn.allizom.net/ |
1730055 to
e67da1c
Compare
ab3dd80 to
ea9fe38
Compare
6e63d47 to
1d4b1c7
Compare
|
And with inspect element on the live site, used these same CSS styling options (compare to https://developer.mozilla.org/en-US/blog/global-privacy-control/)
|
|
Thanks, we're getting there! That said:
|
I mean, that's the explicit |
91161d6 to
6d82c77
Compare
|
Hm, unfortunately the Maybe @pepelsbey has an idea what's going on here, and how to fix it. |
|
Asked Gemini, got a working alternative: switching from |
67c84c8 to
c4b2c32
Compare
c2d960a to
b78fa4d
Compare
|
This PR is basically reverting the changes I made to the external link component to fix the new line behavior (when icon doesn't stick to the last word). Just to fix an edge case. Do we really want that? I don't think we could LLM our way through this. It needs some deeper understanding of the scope and some testing. |
|
Is there an example page where I can see the icon not sticking to the last word with this change while it does on main? I did inspect element and add l's until a word would have stayed on its own line if the icon were to not be taken into account or end up on the next line if it were and it ended up on the next line as expected. |
|
See the PR that introduced the current behavior. |
|
I don't see a difference in the rendering of your codepen and my codepen with the changes from this PR: Your codepen: https://codepen.io/editor/pepelsbey/pen/019e88ad-b90d-71d6-9ec4-798d80d97a33 My codepen: https://codepen.io/editor/danieljacobs/pen/01a086c3-4f9b-7ff2-a066-5ce1cce6fa23 |
|
Notice my codepen switches to: .external-link-positioned {
&::after {
padding-right: 1em;
margin-left: 0.125em;
background-color: currentcolor;
mask-image: var(--external-link);
mask-position-y: 0.1em;
mask-size: contain;
mask-repeat: no-repeat;
content: "\200b" / " (external)";
}
} |
b78fa4d to
911c34a
Compare
|
I think the key change from your PR for the fix was the removal of |
I was unable to reproduce the issue in this PR, i.e. the icon seems to still be glued to the last word. For me, it looks like the changes are fine and don't cause any regression. |
911c34a to
c355419
Compare
|
Added |
c355419 to
b1cdbc2
Compare
|
None of the links in #1885, even before that PR, have explicit whitespace after the text, making it so this CSS should be sufficient. |
7bf5783 to
28597c7
Compare
28597c7 to
83e2f88
Compare
|
It looks like the icon no longer goes in the next line on its own, but the accidental trailing white-space inside the anchor element is now visible in the footer: From my side, the current solution is sufficient. In discussing this with @LeoMcA, we came up with two alternatives: Overriding the external style selectively in other sections, or applying the |














Description
Fix overlapping icons
Motivation
See all issues described in #1776 (comment)
Additional details
N/A
Related issues and pull requests
Fixes #1776