From 2a67556e5dd9749b6a6f7fe324ee656103bc5761 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sat, 11 Oct 2025 18:46:55 +0200 Subject: [PATCH] Fix font-size inheritance in HTML artifact iframes Set explicit font-size: 16px on the element in sandboxed iframes to prevent browser default inheritance quirks that can cause unexpected font sizes (e.g., 75% shown in devtools). This establishes a consistent base font size while still allowing user HTML content to override it on body or specific elements as needed. Fixes the issue where HTML artifacts displayed with inconsistent font sizes due to iframe inheritance behavior. --- packages/web-ui/src/components/SandboxedIframe.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/web-ui/src/components/SandboxedIframe.ts b/packages/web-ui/src/components/SandboxedIframe.ts index c694cc8b..41278e1d 100644 --- a/packages/web-ui/src/components/SandboxedIframe.ts +++ b/packages/web-ui/src/components/SandboxedIframe.ts @@ -495,7 +495,12 @@ export class SandboxIframe extends LitElement { }) .join("\n"); - return `