fix: the sheet page no longer scrolls the document by a topbar
Dropping the invented --rst-shell-bar-h left `height: 100dvh` on the surface, inside a shell that also holds the topbar — so the document came to 771px in a 720px viewport and the whole page scrolled by exactly the bar. A spreadsheet page should not scroll; only its grid should. Fixed with layout rather than another number: the shell becomes a viewport-height flex column, scoped with :has() so it only applies on a page holding a sheet and every other page still scrolls normally, and the surface takes the remainder with flex. Measured back to 720 in 720, document not scrolling, grid scrolling.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018RN4HhHR4rHH3Fxh4LMds5
1 file changed,
+17
−4
internal/sheets/static/sheets.css+17 −4
CI passed — run details
diff --git a/internal/sheets/static/sheets.css b/internal/sheets/static/sheets.css| index 720a93e..c2dc2d4 100644 |
| --- a/internal/sheets/static/sheets.css |
| +++ b/internal/sheets/static/sheets.css |
| @@ -19,13 +19,26 @@ |
| * a spreadsheet is the one screen that should not sit in a padded, |
| * max-width page. |
| * |
| - * The topbar's height is measured by the layout rather than assumed: |
| - * there is no token for it, and a guessed constant is a gap or a |
| - * scrollbar at every width it was not guessed for. */ |
| -[data-sheet-surface] { |
| + * The shell becomes a viewport-height flex column ONLY on a page that |
| + * holds a sheet, so every other page still scrolls normally. :has() is |
| + * what scopes it without a marker class the template would have to |
| + * remember to set. |
| + * |
| + * The surface takes the remaining space with flex rather than |
| + * subtracting a topbar height. There is no token for that height, and a |
| + * guessed constant is a scrolling document at every size it was not |
| + * guessed for — which is exactly what `height: 100dvh` here produced: |
| + * a 771px document in a 720px viewport, off by the topbar. */ |
| +[rst-shell-topbar]:has([data-sheet-surface]) { |
| display: flex; |
| flex-direction: column; |
| height: 100dvh; |
| +} |
| + |
| +[data-sheet-surface] { |
| + display: flex; |
| + flex-direction: column; |
| + flex: 1; |
| min-height: 0; |
| } |