feat: wrap category bar into two rows instead of horizontal scroll
All checks were successful
Build and Deploy / deploy (push) Successful in 14s

- Change .catbar from overflow-x:auto to flex-wrap:wrap
- Show all 14 categories instead of 7 + 'more →'
- Remove flex:0 0 auto from pills to allow natural wrapping

Closes: beb1824d530419b4dc71d6720a9a2c7821139c28280326d48e8073d4aa6b3184
This commit is contained in:
Test 2026-09-22 23:46:06 +00:00 committed by djg
parent 30feebca49
commit 347d411940
2 changed files with 4 additions and 6 deletions

View file

@ -82,9 +82,7 @@ def joke_card(j, reveal=False):
def layout(title, desc, body, path='/', extra_head=''):
nav_cats = ''.join(
'<a href="/category/%s/">%s %s</a>' % (c['slug'], c['emoji'], esc(c['name']))
for c in CATS[:7])
rest = ''.join('<a href="/category/%s/">%s %s</a>' % (c['slug'], c['emoji'], esc(c['name']))
for c in CATS[7:])
for c in CATS)
foot_cats = ''.join('<a href="/category/%s/">%s</a>' % (c['slug'], esc(c['name'])) for c in CATS)
return f"""<!DOCTYPE html>
<html lang="en">
@ -121,7 +119,7 @@ def layout(title, desc, body, path='/', extra_head=''):
</nav>
</div>
<div class="wrap catbar">
{nav_cats}<a href="#all-cats">more →</a>
{nav_cats}
</div>
</header>
<main>

View file

@ -38,8 +38,8 @@ p.page-sub { color: var(--ink-soft); font-size: 1.08rem; max-width: 46rem; margi
.site-nav a { text-decoration: none; color: var(--ink); font-weight: 600; padding: 7px 12px; border-radius: 999px; }
.site-nav a:hover { background: var(--cream); }
.site-nav a.on { background: var(--ink); color: var(--cream); }
.catbar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; }
.catbar a { flex: 0 0 auto; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .86rem; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.catbar { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 12px; }
.catbar a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .86rem; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.catbar a:hover { background: var(--brand2); }
.navtoggle, .navburger { display: none; }