Improve badge truncation behavior
This commit is contained in:
parent
6738ffc28e
commit
3d461bac70
@ -19,6 +19,7 @@ export default function AdminTagBadge({
|
|||||||
'inline-flex items-center gap-2',
|
'inline-flex items-center gap-2',
|
||||||
// Fix nested EntityLink-in-Badge quirk for tags
|
// Fix nested EntityLink-in-Badge quirk for tags
|
||||||
'[&>*>*:first-child]:items-center',
|
'[&>*>*:first-child]:items-center',
|
||||||
|
isTagFavs(tag) && 'translate-y-[0.5px]',
|
||||||
)}>
|
)}>
|
||||||
{isTagFavs(tag)
|
{isTagFavs(tag)
|
||||||
? <FavsTag />
|
? <FavsTag />
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export default function Badge({
|
|||||||
case 'small':
|
case 'small':
|
||||||
return clsx(
|
return clsx(
|
||||||
'px-[5px] h-[17px] md:h-[18px]',
|
'px-[5px] h-[17px] md:h-[18px]',
|
||||||
'text-[0.7rem] font-medium rounded-[0.25rem]',
|
'text-[0.7rem] leading-none font-medium rounded-[0.25rem]',
|
||||||
contrast === 'high'
|
contrast === 'high'
|
||||||
? 'text-invert bg-invert'
|
? 'text-invert bg-invert'
|
||||||
: contrast === 'frosted'
|
: contrast === 'frosted'
|
||||||
@ -53,9 +53,7 @@ export default function Badge({
|
|||||||
className,
|
className,
|
||||||
)}>
|
)}>
|
||||||
<span className={clsx(
|
<span className={clsx(
|
||||||
'max-w-full inline-flex',
|
'max-w-full inline-block truncate',
|
||||||
// Truncate 1 + 2 levels deep
|
|
||||||
'truncate *:truncate',
|
|
||||||
dimContent && 'opacity-50',
|
dimContent && 'opacity-50',
|
||||||
)}>
|
)}>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ export default function FavsTag({
|
|||||||
size={12}
|
size={12}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'text-amber-500',
|
'text-amber-500',
|
||||||
'translate-x-[-1px] translate-y-[-0.5px]',
|
'translate-x-[-1px]',
|
||||||
)}
|
)}
|
||||||
/>}
|
/>}
|
||||||
type={type}
|
type={type}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user