Skip to content

Commit cee3426

Browse files
t3dotggclaude
andcommitted
fix(mcp): agent HTML pages stop painting slab backgrounds
Tell agents to leave the page background unset by default, since it already matches the thread, and to pad any box that does paint its own background. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent f60367b commit cee3426

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎packages/shared/src/htmlRender.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ export const HTML_RENDER_THEME_GUIDE = [
261261
/** Agent-facing layout rules for a page that sits inside a reply. */
262262
export const HTML_RENDER_LAYOUT_GUIDE = [
263263
`The frame is borderless on the thread's background, as wide as the reply column (${HTML_RENDER_COLUMN_WIDTH}px on desktop by default, wider if the reader widens chat, about 360px on phones), and its left edge lines up with your reply text.`,
264+
"The page sits on the thread's own background, so by default leave html, body, and the outermost element with no background color. This overrides general style preferences such as a fixed black page background.",
264265
"Use a fluid width with no horizontal padding on the outermost element, and no outer card, border, or banner title: the page is part of your reply.",
266+
"If a box needs its own background (a mock of a specific screen, a panel that must stand apart), give it at least 16px of padding on every side and var(--radius) corners, so content never touches its edge.",
265267
"Give charts fixed pixel heights rather than heights that scale with width.",
266268
"Let content set the page's height. Avoid viewport-based heights such as 100vh or height:100% on html or body; the frame grows to fit the page, so they can make it grow again and again.",
267269
].join(" ");

0 commit comments

Comments
 (0)