Fix for single word fonts
This commit is contained in:
1 parent
b6678b678d
commit
73c851e810
1 file changed
+9
-1
@@ -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 && (
|
||||
<Box
|
||||
|
||||
Reference in new issue
Block a user