Skip to content

style(ui): 40px theme toggle, FR nav breathing room, explicit script directives - #68

Merged
eaitbrahim merged 1 commit into
mainfrom
fix/theme-toggle-ux-46
Aug 22, 2026
Merged

style(ui): 40px theme toggle, FR nav breathing room, explicit script directives#68
eaitbrahim merged 1 commit into
mainfrom
fix/theme-toggle-ux-46

Conversation

@eaitbrahim

Copy link
Copy Markdown
Contributor

Fixes #46

What changed

1. Theme toggle holds its 40px target at every viewport (src/styles/global.css)
The 2.1rem → 2.5rem size bump from 5073da0 was already on main, but measurement showed the button is a flex item inside .header-actions and was being flex-shrunk to as little as 30.6px wide on crowded desktop bars (the border-radius circle rendered as an ellipse). flex: none keeps it a true 40×40 circle everywhere.

2. French nav no longer crowds at intermediate viewports (src/styles/global.css)
Measured on /fr/: with the previous FR metrics (0.87rem labels, 0.35rem padding) the nine labels needed ~60px more than the bar offers at 1024px, so the nav wrapped into two crowded lines from 1024px all the way through ~1280px. This PR:

  • tightens the base FR nav metrics (0.82rem labels, 0.22rem padding, 0.3rem gap), and
  • adds a scoped 64rem–71.99rem band that reclaims bar room (tighter gutters around the nav and inside the actions cluster) plus one font notch (0.78rem), so all nine links hold a single line from the hamburger breakpoint (1024px) up. 72rem and wider keeps the base FR sizing.

3. Explicit is:inline directives in BaseHead.astro — no change needed
All four script tags (JSON-LD, theme restore, theme toggle, CF analytics) already carry is:inline from 5073da0; astro check reports no hints for that file, so nothing to add.

Verification (all in the worktree)

  • npx astro check: 0 errors, 0 warnings (single pre-existing hint: unused writeFile in scripts/render-tui-shots.mjs, unrelated to this issue)
  • npm run build: full build incl. GitHub-API fetch scripts — 44 pages, complete
  • puppeteer-core + Chrome on the built /fr/ page:
viewport toggle nav lines overflow/spill
390px 40×40 hamburger shown, nav hidden none
768px 40×40 hamburger shown, nav hidden none
1024px 40×40 1 (was 2) none
1050–1280px 40×40 1 (was 2 up to 1280) none
  • /en/ @1024PX re-measured for regression: identical to baseline (FR rules are html[lang="fr"]-scoped; AR/EN untouched)
  • Zero client JS added — CSS only (PRD constraint)

… viewport (#46)

- .theme-toggle: add flex:none — as a flex item in .header-actions it was
  being shrunk to as little as 30.6px wide on crowded desktop bars (the
  2.5rem circle became an ellipse). It now renders a true 40x40 target
  from 390px up.
- html[lang="fr"] nav spacing: the previous FR metrics (0.87rem labels,
  0.35rem padding) still wrapped the nine French labels onto two crowded
  lines from 1024px through ~1280px. Tighten the base FR metrics and add a
  scoped 64rem-71.99rem band (tighter bar gutters + one font notch) so the
  nav holds a single line from the hamburger breakpoint up; 72rem+ keeps
  the base FR sizing.
- BaseHead.astro script directives: already fully is:inline-annotated on
  main (5073da0); astro check reports no hints for it, so no change needed.

Zero client JS added — CSS only.
@sonarqubecloud

Copy link
Copy Markdown

@eaitbrahim
eaitbrahim merged commit 1882f1e into main Aug 22, 2026
2 checks passed
@eaitbrahim
eaitbrahim deleted the fix/theme-toggle-ux-46 branch August 22, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

style(ui): enlarge mobile theme toggle touch target and optimize script directives

1 participant