Commit 0bf970b
committed
Add prev/next pagination and tighten mobile UX
## Pagination
`partials/pagination.hbs` used to be gated on an opt-in
`:pagination:` page attribute that nothing set, so prev/next never
rendered. Rewrite it as a plain `page.previous`/`page.next` check so
every page that is listed in `nav.adoc` now gets a Prev/Next block at
the bottom. Antora skips same-page anchor entries automatically, so a
page like `phoenix/index.adoc` advances to LiveView rather than to one
of its own sub-sections.
The new markup is a two-card `<nav class="pagination">` — each card has
a small uppercase "Previous" / "Next" overline and the destination
page's title, so readers see *where* they're going before tapping. On
mobile the two cards stack (single-column grid); on `sm+` they sit
side by side. Cards have a subtle border, a 4rem minimum height, and a
tactile hover state so they read as links rather than inline text.
## Mobile UX
iPhone-width audit surfaced four real problems; fixed each:
- **Page overflowed horizontally.** AsciiDoc emits a `<div class="title">`
above every listing block containing the file path (e.g.
`lib/demo_web/controllers/product_html/show.html.heex`). In mono +
0.15em tracking that string is ~430px wide and would not wrap, pushing
the whole document past the viewport. Added
`overflow-wrap: anywhere` to `.title` so it breaks on mobile.
- **Nav overlay had no escape.** `.nav-container.is-active` covers the
whole viewport at z-20, which hid the hamburger toggle underneath it
with no way to close. The toggle is now promoted to
`position: fixed; z-index: 30` when `is-active` and switches to an X
icon, so it always floats in the top-right corner of the overlay.
- **Hamburger tap target was 32×32 with a hard-coded dark icon.** Upped
the button to 44×44 (Apple HIG), replaced the `<img src>` with a CSS
mask so the icon inherits `currentColor` and stays visible in both
light and dark mode, and added `aria-label`/`aria-expanded` to the
partial.
- **Padding and type felt cramped.** Trimmed body gutters from `px-6` to
`px-4` on mobile (keeps `sm:px-8` at 640px+), dropped the 17px pad on
the content wrapper, shrunk code blocks from 14px @ p-5 to 13px @ p-4
on mobile (restored at sm+), and narrowed the admonition icon column
from `w-28` to `w-20` on mobile. Wide tables now scroll horizontally
via a `.tableblock { overflow-x: auto }` wrapper instead of shoving
the layout sideways.
Verified at 390×844 by loading each page into a 390px-wide iframe: no
horizontal scroll, pagination stacks, overlay opens and closes cleanly.1 parent 9cdf8d9 commit 0bf970b
4 files changed
Lines changed: 82 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
177 | 209 | | |
178 | 210 | | |
179 | 211 | | |
| |||
185 | 217 | | |
186 | 218 | | |
187 | 219 | | |
188 | | - | |
| 220 | + | |
189 | 221 | | |
190 | 222 | | |
191 | 223 | | |
| |||
265 | 297 | | |
266 | 298 | | |
267 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
268 | 311 | | |
269 | 312 | | |
270 | 313 | | |
| |||
286 | 329 | | |
287 | 330 | | |
288 | 331 | | |
289 | | - | |
| 332 | + | |
290 | 333 | | |
291 | 334 | | |
292 | 335 | | |
| |||
302 | 345 | | |
303 | 346 | | |
304 | 347 | | |
| 348 | + | |
305 | 349 | | |
306 | 350 | | |
307 | 351 | | |
| |||
347 | 391 | | |
348 | 392 | | |
349 | 393 | | |
350 | | - | |
| 394 | + | |
351 | 395 | | |
352 | 396 | | |
353 | 397 | | |
| |||
374 | 418 | | |
375 | 419 | | |
376 | 420 | | |
377 | | - | |
| 421 | + | |
378 | 422 | | |
379 | 423 | | |
380 | 424 | | |
| |||
451 | 495 | | |
452 | 496 | | |
453 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
454 | 503 | | |
455 | 504 | | |
456 | 505 | | |
457 | | - | |
| 506 | + | |
458 | 507 | | |
459 | 508 | | |
460 | | - | |
461 | | - | |
| 509 | + | |
| 510 | + | |
462 | 511 | | |
463 | 512 | | |
464 | 513 | | |
465 | | - | |
| 514 | + | |
466 | 515 | | |
467 | 516 | | |
468 | | - | |
469 | | - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
470 | 520 | | |
471 | 521 | | |
472 | | - | |
473 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
474 | 528 | | |
475 | 529 | | |
476 | 530 | | |
| |||
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | | - | |
4 | | - | |
| 2 | + | |
5 | 3 | | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | | - | |
9 | | - | |
10 | 9 | | |
11 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | | - | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
0 commit comments