Fix popup arrow overlapping text#2070
Conversation
This crops the diamond so that the inner part doesn't overlap any text.
A new value `--arrow-border-size` should be set by elements that include a border on the popup arrow. The arrow size will be increased to account for the additional border. A translation will also be made to ensure the cropping point is on the inner edge of the border. This removes the visual artefact from cropping.
Inform the popup arrow how large its border is so that it can resize/translate appropriately.
Change to start with check to allow tooltip top-left/top-right/etc. values to be assigned correctly.
|
@TCWORLD is attempting to deploy a commit to the Font Awesome Team on Vercel. A member of the Team first needs to authorize it. |
Should be using the tooltip parameter.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I'll have a look at why the popup arrow is not working - it was on my dev setup, but I may have changed something. The I'll do some further tinkering tomorrow. |
0px not 0 for the default, otherwise CSS calculations baulk.
Grow the clipping mask by 1px so there is a little extra overlap to avoid sub-pixel rounding artefacts. Additionally reduce the offset by 0.5px to account for the larger clipping mask and reduce artefacts of the border appearing inside the popovers.
|
@claviska Fixed the missing arrows on the popup - the joys of CSS treating 0 and 0px as different things for size calculations! I've also tried to make a slight tweak to the clipping mask to minimise/remove artefacts caused by sub-pixel rounding, but I think there is more going on - probably related to the translation of the arrow when selecting start/end. I'll investigate. |
For consistency with the CSS nomenclature.
The offset to account for the border needs to be done in popup.ts as that overrides thet translate done in the CSS.
|
Ok, I think I've got it working properly now. I missed that the popup.ts file modifies the position of the arrow which was meant the translation I made in the CSS file was getting lost hence weird visual artefacts. I've corrected this by making the translation part of the positioning in the popup.ts file. |
|
All looks functional now from what I can tell. I've renamed the new variable to I've added the changelog entries as requested. I've also added an explanation of the new variable to the popup.md file. Also added an example of how to stylise the border of the popup, including setting the |
More descriptive name.
It's actually nothing to do with the width of the arrows border, but rather the width of any border applied to the popup body itself.
adcae71 to
6277b6e
Compare
This shows the use of the --popup-border-width parameter along with how to add matching border to the arrow itself.
8dbbc55 to
990f33f
Compare

This is a rehash of #1437 but with additional changes to avoid the visual artefacts that meant that PR could not be merged.
I'm opening this again as the original change was manually applied in the home-assistant fork and keeps getting lost whenever the version is upgraded, so it would be good to get it pushed back upstream.
The backstory for why is the same as in the linked PR, because the arrow on the popup element is a diamond not a triangle, it interferes with the content of the popup:
The original fix was to add a clipping mask to the diamond to turn it into a triangle. This however caused problems when there was a border on the host element - the cropping was to the outside edge of the host border, leaving the border visible.
To resolve this, the arrow now has some additional styling applied to grow and translate it to overlap and thus hide the border of the host. This calculation is done by specifying
--popup-border-widthfor the popup element (given as width of border). The arrow then takes care of scaling itself up to overlap to the inner edge of the border.To visualise it, here is the arrow showing on the popover element that caused problems last time, filled in red to see how it is cropped:
Scaling up the size of the border to demonstrate the accuracy of the maths, we get:
And just normally:
