Skip to content

Commit

Permalink
Fix Union wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
barvian committed Dec 28, 2024
1 parent d35db77 commit 3b765ba
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions site/src/components/Union.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ export interface Props extends HTMLAttributes<'code'> {
const { types, class: cls, ...props } = Astro.props
---

<Type {...props} class:list={[cls, 'inline-flex flex-wrap gap-[0.5em] leading-snug']}>
<Type {...props} class:list={[cls, 'leading-snug']}>
{
types.map((type, i) => (
<span class:list={[i !== types.length - 1 && 'border-r-[0.125em] pr-[0.5em]']}>{type}</span>
<span
class:list={[
'mr-[0.5em] inline-block last:mr-0',
i !== types.length - 1 && 'border-r-[0.125em] pr-[0.5em]'
]}
>
{type}
</span>
))
}
</Type>

0 comments on commit 3b765ba

Please sign in to comment.