mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-12 06:06:37 +03:00
fix(live): don't pass backgroundColor to domToBlob
modern-screenshot force-sets `background-color: X !important` on the root clone's inline style when backgroundColor is passed, clobbering the element's real background and rendering every captured card with the page body color. Omit the option so the canvas stays transparent and the element's own background renders into the foreignObject. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
c7ee722472
commit
99494348bf
@@ -1787,9 +1787,13 @@
|
||||
try {
|
||||
const ms = await loadModernScreenshot();
|
||||
const fontCssText = await collectFontCssText();
|
||||
// Deliberately no `backgroundColor` option. modern-screenshot force-sets
|
||||
// `background-color: X !important` on the root clone's inline style when
|
||||
// that option is passed, clobbering the element's real background. Leave
|
||||
// the canvas transparent; the element's own background renders into the
|
||||
// foreignObject.
|
||||
return await ms.domToBlob(el, {
|
||||
scale: Math.min(window.devicePixelRatio || 1, 2),
|
||||
backgroundColor: getComputedStyle(document.body).backgroundColor || '#ffffff',
|
||||
font: fontCssText ? { cssText: fontCssText } : undefined,
|
||||
});
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user