Skip to content

Add mobile-responsive CSS#13

Open
rdubar wants to merge 3 commits into
agiacalone:mainfrom
rdubar:mobile-responsive-css
Open

Add mobile-responsive CSS#13
rdubar wants to merge 3 commits into
agiacalone:mainfrom
rdubar:mobile-responsive-css

Conversation

@rdubar
Copy link
Copy Markdown

@rdubar rdubar commented Apr 29, 2026

Summary

Adds media queries to both jargon.css (entry pages) and html/jargon.css (letter-index pages) for better reading on mobile devices. No existing rules are changed — the new block is purely additive.

Mobile (≤ 640px)

  • 16px body font, comfortable line-height, horizontal padding
  • DocBook's table-based navheader/navfooter reflowed as flex rows so Prev/Next links wrap correctly instead of overflowing the screen
  • 44px minimum touch targets on nav links (Apple/Google HIG guideline)
  • pre, code, tt wrap to prevent horizontal scroll
  • Images capped at 100% width

Desktop (≥ 900px)

  • Content centred with max-width: 860px for readability on wide screens

Note on viewport meta tag

A <meta name="viewport" content="width=device-width, initial-scale=1"> in the HTML <head> would further improve initial scale on mobile (without it some browsers default to a zoomed-out desktop view). That change touches the XSL build pipeline, so I've left it as a follow-up — happy to take a look at that too if it's useful.


From rdubar/jargon — a CLI for the Jargon File that uses this repo as its data source.

rdubar added 3 commits April 29, 2026 11:01
Appends media queries to both jargon.css (entry pages) and html/jargon.css
(letter-index pages) without touching any existing rules:

- Mobile (≤640px): 16px body font, padding, overflow-wrap; nav tables
  (DocBook navheader/navfooter) reflowed as flex rows so Prev/Next links
  stack correctly instead of overflowing; 44px min touch targets on nav
  links; pre/code/tt wrap to prevent horizontal scroll; images capped at
  100% width.
- Desktop (≥900px): content centred with max-width 860px for readability
  on wide screens.

Note: a <meta name="viewport" content="width=device-width, initial-scale=1">
tag in the HTML templates would further improve initial scale on mobile.
That change would affect the XSL build pipeline and is left as a follow-up.

Co-Authored-By: Roger Dubar <rdubar@gmail.com>
- Insert <meta name="viewport" content="width=device-width, initial-scale=1"/>
  into all 2413 HTML files — without this, mobile browsers render at desktop
  width and scale down, so media queries never fire
- Add html/body overflow-x:hidden + width:100% + box-sizing:border-box to
  the mobile block so content can't escape the viewport
- Add box-sizing and explicit width:100% to navheader/navfooter tables

Co-Authored-By: Roger Dubar <rdubar@gmail.com>
…le row

- Redo viewport meta patching in binary mode — previous approach decoded
  files as UTF-8 and corrupted ISO-8859-1 non-breaking space bytes (0xA0)
  into UTF-8 replacement characters (0xEF BF BD)
- Add tbody/display:block so flex layout reaches tr/td through the browser's
  implicit tbody insertion
- Hide .navheader tr:first-child on mobile — it repeats the entry term name
  which appears immediately below in the content, saving vertical space

Co-Authored-By: Roger Dubar <rdubar@gmail.com>
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.

1 participant