Skip to content

Commit 0bb5f56

Browse files
authored
fix: public viewer iframe footer gap (#229)
* fix: restore flex layout for iframe content to fill viewport The previous commit over-corrected by removing the flex layout along with the * reset. The flex layout (body flex-column + content flex:1) is needed so iframe content (JSX, HTML) fills the remaining viewport height instead of leaving a dark footer gap. Only the * global reset needed to go. * fix: override inline iframe height so flex fills viewport The JsxRenderer sets style="height: 80vh" on the iframe, which beats the stylesheet's flex: 1 rule. Adding height: auto !important neutralizes the inline style and lets flex-grow fill the remaining viewport space, eliminating the dark gap at the bottom of the public viewer.
1 parent b6a794c commit 0bb5f56

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

cmd/preview-content-viewer/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ const viewerHTML = `<!DOCTYPE html>
2424
<style>
2525
:root,[data-theme="light"]{--bg:#f5f5f5;--bg-surface:#fff;--text:#1a1a1a;--text-muted:#6b7280;--page-border:#e5e5e5;--badge-bg:#e5e7eb;--badge-text:#374151;--toggle-hover:#f3f4f6;--background:0 0% 96%;--foreground:0 0% 10%;--card:0 0% 100%;--card-foreground:0 0% 10%;--muted:0 0% 96%;--muted-foreground:220 9% 46%;--border:0 0% 90%;--primary:221.2 83.2% 53.3%;--primary-foreground:210 40% 98%}
2626
[data-theme="dark"]{--bg:#111113;--bg-surface:#1a1a1e;--text:#e4e4e7;--text-muted:#71717a;--page-border:#27272a;--badge-bg:#27272a;--badge-text:#a1a1aa;--toggle-hover:#27272a;--background:240 6% 6%;--foreground:240 5% 90%;--card:240 5% 11%;--card-foreground:240 5% 90%;--muted:240 4% 16%;--muted-foreground:240 5% 48%;--border:240 4% 16%;--primary:217.2 91.2% 59.8%;--primary-foreground:222.2 47.4% 11.2%}
27-
html,body{margin:0;padding:0;box-sizing:border-box}
28-
body{font-family:system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text)}
29-
.header{box-sizing:border-box;background:var(--bg-surface);border-bottom:1px solid var(--page-border);padding:12px 24px;display:flex;align-items:center;gap:12px}
27+
html,body{margin:0;padding:0;box-sizing:border-box;height:100%}
28+
body{font-family:system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text);display:flex;flex-direction:column;min-height:100vh}
29+
.header{box-sizing:border-box;background:var(--bg-surface);border-bottom:1px solid var(--page-border);padding:12px 24px;display:flex;align-items:center;gap:12px;flex-shrink:0}
3030
.header h1{font-size:16px;font-weight:600;flex:1}
3131
.badge{font-size:11px;background:var(--badge-bg);color:var(--badge-text);padding:2px 8px;border-radius:10px}
3232
.theme-toggle{background:none;border:1px solid var(--page-border);border-radius:6px;padding:4px 8px;cursor:pointer;color:var(--text-muted)}
33-
.content{box-sizing:border-box;width:100%;padding:16px}
34-
.content iframe{flex:1;min-height:60vh}
35-
nav{box-sizing:border-box;display:flex;gap:8px;padding:12px 24px;background:var(--bg-surface);border-bottom:1px solid var(--page-border)}
33+
.content{box-sizing:border-box;width:100%;padding:16px;flex:1;display:flex;flex-direction:column}
34+
.content iframe{flex:1;min-height:60vh;height:auto !important}
35+
nav{box-sizing:border-box;display:flex;gap:8px;padding:12px 24px;background:var(--bg-surface);border-bottom:1px solid var(--page-border);flex-shrink:0}
3636
nav a{color:var(--text-muted);text-decoration:none;padding:4px 12px;border-radius:6px;font-size:13px}
3737
nav a:hover{background:var(--toggle-hover)}
3838
nav a.active{background:var(--badge-bg);color:var(--badge-text)}

pkg/portal/templates/public_viewer.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@
4949
--primary: 217.2 91.2% 59.8%;
5050
--primary-foreground: 222.2 47.4% 11.2%;
5151
}
52-
html, body { margin: 0; padding: 0; box-sizing: border-box; }
52+
html, body { margin: 0; padding: 0; box-sizing: border-box; height: 100%; }
5353
body {
5454
font-family: system-ui, -apple-system, sans-serif;
5555
background: var(--bg);
5656
color: var(--text);
57+
display: flex;
58+
flex-direction: column;
59+
min-height: 100vh;
5760
}
5861
.header {
5962
box-sizing: border-box;
@@ -63,6 +66,7 @@
6366
display: flex;
6467
align-items: center;
6568
gap: 12px;
69+
flex-shrink: 0;
6670
}
6771
.brand {
6872
display: flex;
@@ -153,16 +157,21 @@
153157
padding: 4px 24px;
154158
border-bottom: 1px solid var(--page-border);
155159
background: var(--bg-surface);
160+
flex-shrink: 0;
156161
line-height: 1.4;
157162
}
158163
.content {
159164
box-sizing: border-box;
160165
width: 100%;
161166
padding: 16px;
167+
flex: 1;
168+
display: flex;
169+
flex-direction: column;
162170
}
163171
.content iframe {
164172
flex: 1;
165173
min-height: 60vh;
174+
height: auto !important;
166175
}
167176
</style>
168177
<script>

0 commit comments

Comments
 (0)