Skip to content

Commit 58866c4

Browse files
committed
1
1 parent 55b7e7b commit 58866c4

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

src/lib/ZHeader/ZHeader.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
*/
4343
let starts = $state(Array(Object.keys(others).length));
4444
45+
let headWidth = $derived([...snippets].reduce((acc, cur) => acc + cur.width, 0));
46+
$inspect(headWidth, 'headWidth');
4547
/**
4648
* To save configs
4749
* */
@@ -224,16 +226,16 @@
224226
let copy = snippets.map((s) => s).sort((a, b) => get(a.start) - get(b.start));
225227
for (let i = 0; i < copy.length; i++) {
226228
if (i % 2 === 0 || i === copy.length - 1) {
227-
const base = get(copy[i].start);
228-
autoAdjust(base, bodyWidth, copy[i]);
229+
const baseLine = get(copy[i].start);
230+
autoAdjust(baseLine, bodyWidth, copy[i]);
229231
}
230232
}
231233
saveCfg();
232234
}, 501);
233235
}}
234236
/>
235237

236-
<div id="rootHead">
238+
<div id="rootHead" style="min-width: {headWidth}px;">
237239
{#each snippets as snippet, i}
238240
<!-- svelte-ignore a11y_no_static_element_interactions -->
239241
<div

src/routes/+layout.svelte

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -350,26 +350,13 @@
350350
}
351351
& div.topInnerContainer {
352352
max-width: var(--main-max-width);
353+
min-width: fit-content;
353354
padding: 0 1rem 0 0;
354355
margin-left: auto;
355356
margin-right: auto;
356357
display: flex;
357358
align-items: center;
358359
height: var(--header-block-height);
359-
& header.top {
360-
box-sizing: border-box;
361-
font-weight: normal;
362-
padding: 0 2vw 0 1rem;
363-
width: 100%;
364-
display: flex;
365-
flex: 1 1;
366-
gap: 0.5rem;
367-
align-items: center;
368-
justify-content: flex-start;
369-
& * {
370-
pointer-events: auto;
371-
}
372-
}
373360
}
374361
}
375362
main {

0 commit comments

Comments
 (0)