fix(web): align monogram project icons in menus (#11806)

Co-authored-by: Claude Fable 5 <[email protected]>
This commit is contained in:
Julius MarmingeandClaude Fable 5 authored and GitHub committed 2026-09-14 16:09:33 -07:00
1 parent 7931227977
commit 5bf43c9f3d
1 file changed
+39 -34
+39 -34
View File
@@ -112,44 +112,49 @@ function ProjectFaviconFallback({
}) {
if (projectName && projectName.trim().length > 0) {
const identity = deriveProjectIdentity(projectName);
// Wrapped like the emoji and Lucide branches so the monogram sits where an
// <img> favicon would. Menu items, buttons and the like pull every bare svg
// in with [&_svg]:-mx-0.5 to trim the padding stroke icons carry, and this
// tile has no such padding.
return (
<svg
<span
aria-hidden="true"
viewBox="0 0 16 16"
className={cn(
"size-4 shrink-0 overflow-hidden rounded-[25%] font-mono select-none",
className,
)}
style={{
backgroundColor: identity.background,
backgroundImage: `linear-gradient(145deg, ${identity.highlight}, ${identity.background} 72%)`,
}}
className={cn("inline-flex size-4 shrink-0 items-center justify-center", className)}
>
<text
x="8"
y="10.8"
textAnchor="middle"
fill="white"
className="font-mono"
fontSize="8.25"
fontWeight="700"
textLength="12"
lengthAdjust="spacingAndGlyphs"
textRendering="geometricPrecision"
<svg
viewBox="0 0 16 16"
className="size-full overflow-hidden rounded-[25%] font-mono select-none"
style={{
backgroundColor: identity.background,
backgroundImage: `linear-gradient(145deg, ${identity.highlight}, ${identity.background} 72%)`,
}}
>
{identity.monogram}
</text>
<rect
x="0.25"
y="0.25"
width="15.5"
height="15.5"
rx="3.75"
fill="none"
strokeWidth="0.5"
className="stroke-black/10 dark:stroke-white/10"
/>
</svg>
<text
x="8"
y="10.8"
textAnchor="middle"
fill="white"
className="font-mono"
fontSize="8.25"
fontWeight="700"
textLength="12"
lengthAdjust="spacingAndGlyphs"
textRendering="geometricPrecision"
>
{identity.monogram}
</text>
<rect
x="0.25"
y="0.25"
width="15.5"
height="15.5"
rx="3.75"
fill="none"
strokeWidth="0.5"
className="stroke-black/10 dark:stroke-white/10"
/>
</svg>
</span>
);
}