mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 11:02:17 +00:00
Fix font-size inheritance in HTML artifact iframes
Set explicit font-size: 16px on the <html> 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.
This commit is contained in:
parent
b5648eaabd
commit
2a67556e5d
1 changed files with 6 additions and 1 deletions
|
|
@ -495,7 +495,12 @@ export class SandboxIframe extends LitElement {
|
|||
})
|
||||
.join("\n");
|
||||
|
||||
return `<script>
|
||||
return `<style>
|
||||
html {
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.sandboxId = ${JSON.stringify(sandboxId)};
|
||||
${dataInjection}
|
||||
${bridgeCode}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue