diff --git a/.changeset/six-frogs-destroy.md b/.changeset/six-frogs-destroy.md new file mode 100644 index 0000000000..e20054df85 --- /dev/null +++ b/.changeset/six-frogs-destroy.md @@ -0,0 +1,6 @@ +--- +'@twilio-paste/avatar': patch +'@twilio-paste/core': patch +--- + +[Avatar] Prevent underlines from being added to Avatar initials inside of anchors or display pills diff --git a/packages/paste-core/components/avatar/__tests__/__snapshots__/avatar.test.tsx.snap b/packages/paste-core/components/avatar/__tests__/__snapshots__/avatar.test.tsx.snap index cfe8b52f05..6021cced12 100644 --- a/packages/paste-core/components/avatar/__tests__/__snapshots__/avatar.test.tsx.snap +++ b/packages/paste-core/components/avatar/__tests__/__snapshots__/avatar.test.tsx.snap @@ -5,6 +5,7 @@ exports[`Avatar image should render responsive css with an image 1`] = ` .emotion-0 { box-sizing: border-box; overflow: hidden; + text-align: center; width: sizeIcon30; height: sizeIcon30; background-color: colorBackgroundUser; @@ -67,6 +68,7 @@ exports[`Avatar intials should render responsive css 1`] = ` .emotion-0 { box-sizing: border-box; overflow: hidden; + text-align: center; width: sizeIcon10; height: sizeIcon10; background-color: colorBackgroundUser; @@ -94,9 +96,9 @@ exports[`Avatar intials should render responsive css 1`] = ` color: inherit; font-size: fontSize10; line-height: lineHeight10; - display: block; + display: inline-block; font-weight: fontWeightBold; - text-align: center; + vertical-align: top; -webkit-text-decoration: none; text-decoration: none; } diff --git a/packages/paste-core/components/avatar/src/index.tsx b/packages/paste-core/components/avatar/src/index.tsx index 36095206a0..2779a17d9a 100644 --- a/packages/paste-core/components/avatar/src/index.tsx +++ b/packages/paste-core/components/avatar/src/index.tsx @@ -28,11 +28,11 @@ const AvatarContents: React.FC = ({name, size = DEFAULT_SIZE return ( ( as="div" element={element} overflow="hidden" + textAlign="center" ref={ref} size={size} {...colorVariants[color]} diff --git a/packages/paste-core/components/display-pill-group/stories/index.stories.tsx b/packages/paste-core/components/display-pill-group/stories/index.stories.tsx index c48aa5d62a..2ab6af3fec 100644 --- a/packages/paste-core/components/display-pill-group/stories/index.stories.tsx +++ b/packages/paste-core/components/display-pill-group/stories/index.stories.tsx @@ -26,6 +26,10 @@ export const Basic: React.FC = () => { Baseball + + + Bowling + Basketball Soccer