Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions resources/js/components/bio-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,28 @@ function GitHubMention({ handle }: { handle: string }) {
rel="noopener noreferrer nofollow ugc"
title={href}
aria-label={`@${handle} on GitHub`}
className="inline-flex h-[1.55em] items-center gap-[0.3em] rounded-md border bg-muted pr-[0.55em] pl-[calc(0.2em-1px)] align-[-0.3em] text-[0.93em] font-medium whitespace-nowrap text-foreground transition-colors hover:border-primary/45 hover:bg-primary-soft hover:text-primary-hover"
className="inline-flex h-[1.55em] max-w-full items-baseline gap-[0.2em] rounded-[0.3em] border bg-muted px-[calc(0.2em-1px)] align-baseline text-[0.93em] font-medium whitespace-nowrap text-inherit transition-colors hover:border-primary/45 hover:bg-primary-soft hover:text-primary-hover"
data-test="bio-mention"
>
{/* A handle GitHub doesn't know has no avatar, so the broken image leaves just this placeholder. */}
<span className="size-[1.15em] shrink-0 overflow-hidden rounded-[calc(var(--radius-md)-0.2em)] bg-border">
{/* A CSS symbol keeps the fallback out of copied bio text. */}
<span
aria-hidden="true"
className="relative flex size-[1.15em] shrink-0 items-center justify-center self-center overflow-hidden rounded-[0.1em] bg-border before:text-[0.75em] before:leading-none before:text-muted-foreground before:content-['@']"
>
<img
key={href}
src={`${href}.png?size=40`}
alt=""
width={20}
height={20}
loading="lazy"
className="size-full"
className="absolute inset-0 size-full bg-border object-cover"
onError={(event) => {
event.currentTarget.style.visibility = 'hidden';
}}
/>
</span>
<span>
<span className="min-w-0 truncate py-[calc(0.275em-1px)] leading-none">
<span className="text-[0px]">@</span>
{handle}
</span>
Expand Down