From 73c851e810a7ca1de37171aad8464bec5785f397 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Tue, 17 Feb 2026 16:22:49 -0600 Subject: [PATCH] Fix for single word fonts --- src/app/features/room/message/Message.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index 55968703..e9e1a9a7 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -784,7 +784,15 @@ export const Message = as<'div', MessageProps>( const usernameColor = validLocalColor || validSpaceColor || (legacyUsernameColor ? colorMXID(senderId) : tagColor); const rawFont = localFont || spaceFont; - const usernameFont = rawFont ? `"${sanitizeFont(rawFont)}", var(--font-secondary) !important` : undefined; + let usernameFont: string | undefined; + + if (rawFont) { + const cleanFont = sanitizeFont(rawFont); + // leave quotes off of single words, otherwise monospace or sans-serif dont work + usernameFont = cleanFont.includes(' ') + ? `"${cleanFont}", var(--font-secondary)` + : `${cleanFont}, var(--font-secondary)`; + } const headerJSX = !collapse && (