diff --git a/studio/frontend/src/features/settings/stores/appearance-custom-store.ts b/studio/frontend/src/features/settings/stores/appearance-custom-store.ts index b8c8d96f5a..f3618ddca5 100644 --- a/studio/frontend/src/features/settings/stores/appearance-custom-store.ts +++ b/studio/frontend/src/features/settings/stores/appearance-custom-store.ts @@ -479,6 +479,8 @@ export function applyCustomizationToDocument( "--font-sans", c.uiFont ? `"${c.uiFont}", ${DEFAULT_SANS_STACK}` : null, ); + // Custom interface fonts cascade into chat and opt out of its Inter tuning. + el.toggleAttribute("data-ui-font", Boolean(c.uiFont)); setVar( "--font-heading", c.headingFont ? `"${c.headingFont}", ${DEFAULT_HEADING_STACK}` : null, diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.css index 2192cfb2cd..52ca81e064 100644 --- a/studio/frontend/src/index.css +++ b/studio/frontend/src/index.css @@ -633,6 +633,13 @@ html.no-font-smoothing body { -moz-osx-font-smoothing: auto; } +/* Match Inter's lighter macOS rendering. Keep 410 when smoothing is off or a + custom font reaches chat. */ +html.render-linux:not(.no-font-smoothing):not([data-chat-font]):not([data-ui-font]) + :is(.aui-assistant-message-root, .aui-user-message-root) { + font-weight: 350; +} + /* Chat font: only applies while a custom chat font is set. Elements with explicit font utilities (headings, code) keep their own families. */ html[data-chat-font] .aui-root { diff --git a/studio/frontend/src/main.tsx b/studio/frontend/src/main.tsx index d0ddf2fc6e..e3b2bceccf 100644 --- a/studio/frontend/src/main.tsx +++ b/studio/frontend/src/main.tsx @@ -36,6 +36,13 @@ if (!rootElement) { initializeLocale(); +// Rasterization follows the browser OS, not the potentially remote server. +// This adjustment is calibrated for desktop Linux, so exclude Android. +const uaLower = navigator.userAgent.toLowerCase(); +if (uaLower.includes("linux") && !uaLower.includes("android")) { + document.documentElement.classList.add("render-linux"); +} + createRoot(rootElement).render(