Skip to content

Commit

Permalink
remove whitespace from links
Browse files Browse the repository at this point in the history
  • Loading branch information
aczw committed Nov 24, 2023
1 parent bd874a5 commit 803a3b2
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/components/link.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ interface Props extends HTMLAttributes<"a"> {
}
const { icon = true, newTab = false, className, ...attrs } = Astro.props;
// partially taken from https://github.com/bdsqqq/igorbedesqui.com/blob/1aaf4c14f1de110ff00cf4a0db1a1f3d13d18193/components/ui/StyledLink.tsx#L49
---

<a
Expand All @@ -20,17 +22,10 @@ const { icon = true, newTab = false, className, ...attrs } = Astro.props;
className,
)}
{...attrs}
>
<slot />
{
/** partially copied from https://github.com/bdsqqq/igorbedesqui.com/blob/1aaf4c14f1de110ff00cf4a0db1a1f3d13d18193/components/ui/StyledLink.tsx#L49 */
><slot />{
newTab && icon ? (
<span class="whitespace-nowrap">
<ArrowUpRight
size={14}
class="inline align-baseline"
/>
</span>
// prettier-ignore
<span class="whitespace-nowrap"><ArrowUpRight size={14} class="inline align-baseline" /></span>
) : null
}
</a>
}</a
>

0 comments on commit 803a3b2

Please sign in to comment.