Changeset 0.22.9 (#151)
This commit is contained in:
@@ -348,13 +348,18 @@ function popOutExtBlock(blockId) {
|
||||
|
||||
const lang = block.getAttribute('data-ext-lang') || '';
|
||||
|
||||
// Read current theme colors so the iframe respects light/dark mode
|
||||
const cs = getComputedStyle(document.documentElement);
|
||||
const bgColor = cs.getPropertyValue('--bg-surface').trim() || '#fff';
|
||||
const textColor = cs.getPropertyValue('--text').trim() || '#1a1a2e';
|
||||
|
||||
// Wrap in a minimal HTML document for the iframe
|
||||
const html = `<!DOCTYPE html>
|
||||
<html><head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
body { margin: 0; padding: 16px; display: flex; justify-content: center;
|
||||
align-items: flex-start; min-height: 100vh; background: #fff;
|
||||
align-items: flex-start; min-height: 100vh; background: ${bgColor}; color: ${textColor};
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
|
||||
body > * { max-width: 100%; }
|
||||
svg { max-width: 100%; height: auto; }
|
||||
|
||||
Reference in New Issue
Block a user