Skip to content

Commit d2b0237

Browse files
committed
Remove bottom padding from CodeMirror content in code dialogs
1 parent 3f94538 commit d2b0237

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

src/lib/components/dialogs/CodePreviewDialog.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
const MAX_LINES = 35;
2828
const LINE_HEIGHT_PX = 18.2; // CodeMirror default with 14px font
2929
const HEADER_HEIGHT_PX = 41; // Dialog header
30-
const CM_PADDING_PX = 16; // .cm-content padding (8px top + 8px bottom)
30+
const CM_PADDING_PX = 8; // .cm-content top padding only (bottom removed via CSS)
3131
3232
let lineCount = $derived(code.split('\n').length);
3333
let dialogHeight = $derived(() => {
@@ -205,6 +205,14 @@
205205
height: 100%;
206206
}
207207
208+
.code-preview :global(.cm-scroller) {
209+
overflow: auto;
210+
}
211+
212+
.code-preview :global(.cm-content) {
213+
padding: 8px 0 0 0;
214+
}
215+
208216
.loading {
209217
display: flex;
210218
align-items: center;

src/lib/components/dialogs/ExportDialog.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
const MAX_LINES = 35;
4343
const LINE_HEIGHT_PX = 18.2; // CodeMirror default with 14px font
4444
const HEADER_HEIGHT_PX = 41; // Dialog header
45-
const CM_PADDING_PX = 16; // .cm-content padding (8px top + 8px bottom)
45+
const CM_PADDING_PX = 8; // .cm-content top padding only (bottom removed via CSS)
4646
4747
let lineCount = $derived(pythonCode.split('\n').length);
4848
let dialogHeight = $derived(() => {
@@ -225,6 +225,14 @@
225225
height: 100%;
226226
}
227227
228+
.code-preview :global(.cm-scroller) {
229+
overflow: auto;
230+
}
231+
232+
.code-preview :global(.cm-content) {
233+
padding: 8px 0 0 0;
234+
}
235+
228236
.loading {
229237
display: flex;
230238
align-items: center;

0 commit comments

Comments
 (0)