Skip to content
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

chore(avatar): remove underline on avatars in anchors #2685

Merged
merged 6 commits into from Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .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
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -94,7 +96,7 @@ 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;
-webkit-text-decoration: none;
Expand Down
3 changes: 2 additions & 1 deletion packages/paste-core/components/avatar/src/index.tsx
Expand Up @@ -28,7 +28,7 @@ const AvatarContents: React.FC<AvatarContentProps> = ({name, size = DEFAULT_SIZE
return (
<Text
as="abbr"
display="block"
display="inline-block"
fontSize={computedTokenNames.fontSize}
fontWeight="fontWeightBold"
lineHeight={computedTokenNames.lineHeight}
Expand Down Expand Up @@ -89,6 +89,7 @@ const Avatar = React.forwardRef<HTMLDivElement, AvatarProps>(
as="div"
element={element}
overflow="hidden"
textAlign="center"
ref={ref}
size={size}
{...colorVariants[color]}
Expand Down
Expand Up @@ -26,6 +26,10 @@ export const Basic: React.FC = () => {
<Avatar size="sizeIcon10" name="avatar example" src="./avatars/avatar4.png" />
Baseball
</DisplayPill>
<DisplayPill href="/">
<Avatar size="sizeIcon10" name="Avatar Anchor Example" />
Bowling
</DisplayPill>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: thanks for including a story so we can ensure this doesn't break!

<DisplayPill>Basketball</DisplayPill>
<DisplayPill>Soccer</DisplayPill>
</DisplayPillGroup>
Expand Down