Skip to content

Commit ae9df50

Browse files
authored
fix: public viewer iframe gap by making wrapper div a flex container (#230)
The wrapper div inside .content defaulted to flex: 0 1 auto, so it did not stretch to fill .content. The iframe's flex: 1 had no effect because its parent was not a flex container. Adding .content > div as a flex column lets the iframe expand to fill the remaining space.
1 parent 0bb5f56 commit ae9df50

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

cmd/preview-content-viewer/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ body{font-family:system-ui,-apple-system,sans-serif;background:var(--bg);color:v
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;flex:1;display:flex;flex-direction:column}
34-
.content iframe{flex:1;min-height:60vh;height:auto !important}
33+
.content{box-sizing:border-box;width:100%;padding:16px;flex:1;display:flex;flex-direction:column;overflow:hidden}
34+
.content>div{flex:1;display:flex;flex-direction:column}
35+
.content iframe{flex:1;min-height:60vh;width:100%;height:auto !important;display:block}
3536
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}
3637
nav a{color:var(--text-muted);text-decoration:none;padding:4px 12px;border-radius:6px;font-size:13px}
3738
nav a:hover{background:var(--toggle-hover)}

pkg/portal/templates/public_viewer.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,19 @@
167167
flex: 1;
168168
display: flex;
169169
flex-direction: column;
170+
overflow: hidden;
171+
}
172+
.content > div {
173+
flex: 1;
174+
display: flex;
175+
flex-direction: column;
170176
}
171177
.content iframe {
172178
flex: 1;
173179
min-height: 60vh;
180+
width: 100%;
174181
height: auto !important;
182+
display: block;
175183
}
176184
</style>
177185
<script>

0 commit comments

Comments
 (0)