minor adjustments

This commit is contained in:
Vincent van der Wal
2026-08-01 16:07:32 +02:00
parent 17cf8df109
commit ae88140f79
13 changed files with 129 additions and 122 deletions
+11 -1
View File
@@ -126,7 +126,16 @@
return new Promise((resolve) => setTimeout(resolve, FADE_OUT_MS));
});
afterNavigate(() => {
let mainEl = $state<HTMLElement | null>(null);
afterNavigate((navigation) => {
// The page scrolls inside <main>, not the window, so SvelteKit's own scroll
// handling never touches it and a new page would open half way down.
// Back/forward and in-page anchors keep their position.
if (navigation.type !== 'popstate' && !navigation.to?.url.hash) {
mainEl?.scrollTo({ top: 0 });
}
if (typeof document.startViewTransition === 'function' || reducedMotion()) {
contentVisible = true;
return;
@@ -202,6 +211,7 @@
flex-col + flex-1 below keeps the footer on the bottom edge even when
the page is too short to fill the viewport. -->
<main
bind:this={mainEl}
class={fullBleed
? 'flex-1 overflow-hidden'
: 'flex flex-1 flex-col overflow-y-auto p-3 lg:px-8 lg:py-6'}
@@ -472,7 +472,7 @@
--night-icon-nudge: 4px;
/* compact only: signed shift that lands the lone icon dead centre in the
square tile (measured against the tile's mid-line) */
--icon-lift: -1px;
--icon-lift: 1px;
/* cell bottom padding (roomy when full, a little breathing room under the
temps when compact so they don't sit on the tile edge). The compact
tile is taller than its content here, so the leftover slack already
@@ -540,7 +540,7 @@
--tmax-padx-min: 6px;
--pt-min: 5px;
--pb-min: 6px;
--icon-lift: 0px;
--icon-lift: 1px;
}
}
@@ -899,16 +899,24 @@
padding: 1px;
font-size: 10px;
}
/* The row-header icon and the fixed cell height are what actually set the
row height, so both come down explicitly. */
.cell :global(svg),
/* The row-header icon was setting the height of every row it sat in - the
stacked icon + label + unit needed ~52px while the value cells only
needed 34. The label already names the row, so on phones the icon goes
and the cells decide the height. */
.hdr :global(svg) {
display: none;
}
.cell :global(svg) {
width: 22px;
height: 22px;
}
.cell {
height: 34px;
}
/* except precipitation, whose cell is a bar chart and needs the room */
.precip-cell {
height: 46px;
}
.hdr :global(span) {
font-size: 9px;
line-height: 1.15;