diff --git a/ogre/src/components/shared/card-header.tsx b/ogre/src/components/shared/card-header.tsx --- a/ogre/src/components/shared/card-header.tsx +++ b/ogre/src/components/shared/card-header.tsx @@ -13,10 +13,18 @@ ownerHandle, repoName, }: CardHeaderProps) { + const text = `${ownerHandle} / ${repoName}`; + const BASE_SIZE = TYPOGRAPHY.cardHeader.fontSize; + const MAX_CHARS = 28; + const fontSize = + text.length > MAX_CHARS + ? Math.max(28, Math.floor((BASE_SIZE * MAX_CHARS) / text.length)) + : BASE_SIZE; + return ( - + {ownerHandle} / {repoName}