web-components icon indicating copy to clipboard operation
web-components copied to clipboard

refactor!: replace abbr SVG with <div> element

Open vursen opened this issue 7 months ago • 2 comments

Description

Replaces the avatar's abbr SVG with a <div> element, following up on #9316, which made the same change for the icon SVG.

This also fixes the issue of abbr rendering with the wrong color in the new base styles:

Before After
localhost_8000_dev_avatar html (1) localhost_8000_dev_avatar html

[!WARNING] This change may be breaking, as font-size on [part=abbr] now behaves differently due to removal of SVG scaling.

Type of change

  • [x] Refactor

vursen avatar May 28 '25 12:05 vursen

I don't like that now the abbreviation isn't exactly centered, when we rely on the line-height to center it. But that depends on the font, how the characters are centered in the line box.

I’d rather make the avatar host a flex container and use align-items: center and then line-height: 0 or text-box: cap alphabetic (only supported in Chrome and Safari 18.2) to properly center the text.

Was there some issue using line-height: 0 that I already forgot?

jouni avatar May 30 '25 08:05 jouni

Closing as not planned.

vursen avatar Jul 10 '25 13:07 vursen