docs: propose modernizing user guide typography#10133
docs: propose modernizing user guide typography#10133paulbalandan wants to merge 1 commit intocodeigniter4:4.8from
Conversation
|
I think the proposal is reasonable, and I'm not against the changes. The readability arguments make sense, and using a deliberate monospace font for code blocks is a clear improvement. It also raises the bigger docs question. We already started the move from Sphinx to MkDocs in codeigniter4/docs-update, and maybe that is the more worthwhile direction to pursue. It would require more time, work, and some compromises, since Markdown does not provide PHP class descriptions in the same way. We would need to either drop that, transform it somehow, or handle API-style docs separately. I would be interested to hear your take on that as well. The same goes for the website. If we are revisiting typography and presentation anyway, a broader refresh might make more sense than just a font change. With current AI tools, that kind of work feels much more within reach than it used to be. We are also a bit blocked on website updates right now. A new site deploy expects PHP 8.2+, while the forum is still on an older version, so there are some infrastructure issues to sort out before taking on anything bigger. Maybe this is also a good moment to consider a static site generator instead of using the framework for the website. That could make deployment much easier, including via GitHub Pages or something similar. Overall, I'm not against this PR. If we make the change, I would lean toward the full version over Plan B. But the larger proposal probably fits better into a wider conversation about the docs direction and the website. Answers:
|
842c59e to
f47ba99
Compare
|
Thanks @michalsn, really helpful feedback. I've updated the PR body and pushed a commit switching the On On the API-docs question specifically: two-tier docs — MkDocs-Material for handwritten guides, with an auto-generated API reference using phpDocumentor linked from the sidebar as a separate section. Sidesteps the Markdown-can't-replicate- On the website & static SSG — agree. The website ↔ framework ↔ forum PHP-version coupling is tax with no upside, and static (Hugo/11ty/Astro) fits a marketing site better. Separate conversation though, so I'll open the coordinated On Raleway as brand typography — appreciate the response; that's what I needed to propose the full version over Plan B. Next from my side:
|
|
About |
f47ba99 to
85f062a
Compare



Description
Background
The user guide currently bundles Raleway locally (6
@font-faceblocks inuser_guide_src/source/_static/css/citheme.css, and 30 font files totaling ~1.1 MB underuser_guide_src/source/_static/fonts/Raleway/). That setup dates to February 2020, commita57d141("Change font to 'Raleway' (CI's 'official' font)"), followed by a short stabilization series ending with80ec0c0. It has not been revisited in ~6 years.Verified that
codeigniter4projects/websitecurrently ships the identical Raleway bundle inpublic/assets/css/ci-theme.css— same 6 variants (200/400/700 × normal/italic), same legacy formats. So brand alignment between the docs and the marketing site today is real and deliberate. Any serious proposal to change the user guide font therefore needs to either (a) keep it aligned with the website, or (b) change both together.Why re-open the question
Three reasons to revisit the 2020 choice, independent of which font ends up winning:
.eot(IE 6–9 — Microsoft retired IE in June 2022) and.svgfonts (pre-iOS 4.2 Safari). Modern browsers all use.woff2. The legacy formats are dead weight in every clone, CI job, and release.SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", ..., so readers on macOS, Windows, and Linux each see a different monospace — no consistency, no programming ligatures, no deliberate choice. This is independent of the brand-font question and is probably the single biggest readability win available.Proposal (full)
Body + headings: Inter — a neutral sans-serif designed specifically for UI and on-screen reading by Rasmus Andersson (ex-Figma, ex-Spotify), SIL OFL-licensed. It's become the de facto choice for modern technical documentation (Tailwind, Vercel, Laravel, GitHub's design system). Much better legibility at body sizes than a display sans like Raleway. Reasonable alternatives worth discussing: Source Sans 3, IBM Plex Sans, Work Sans. The point isn't "Inter is the only right answer," it's "a purpose-built reading sans fits the docs better than a display sans."
Code: JetBrains Mono — with OpenType
caltligatures enabled (renders=>,!=,->,<=,>=,===,!==as single glyphs in PHP samples). SIL OFL. Alternatives: Fira Code, Cascadia Code, Source Code Pro.Delivery: self-hosted
.woff2(updated per @neznaika0's review feedback — previously proposed via Google Fonts, then Bunny Fonts CDN). 10 latin-subset.woff2files totaling ~252 KB, underuser_guide_src/source/_static/fonts/Inter/(6 variants) anduser_guide_src/source/_static/fonts/JetBrainsMono/(4 variants). Each@font-facedeclaresunicode-rangefor the latin subset so glyphs outside the range fall back cleanly to system fonts, and usesfont-display: swapso text paints immediately with the fallback stack rather than blocking. Still a significant reduction from the original Raleway bundle (~1.1 MB across 30 legacy-format files) despite gaining a monospace family.Coordinated change
For consistency with the marketing site, a matching PR would be opened at
codeigniter4projects/websitetouchingpublic/assets/css/ci-theme.cssandpublic/assets/fonts/. I'll open that once there's signal here — no point in a two-repo change if the answer on this one is "no."Plan B (if a full brand change isn't on the table)
If the CodeIgniter Foundation wants to preserve Raleway for brand consistency, I'd narrow this PR to the code-block-only improvements:
<pre>and<code>self-hosted as.woff2— no brand conflict, high dev-facing value..rst-content div[class^=highlight] pre,.rst-content pre.literal-block,.rst-content .linenodiv pre) so the chosen font wins the cascade over the RTD theme's fallbacks..eotand.svgfiles from the Raleway bundle (~400 KB cleanup for dead-browser formats, no visible change on any supported browser).Plan B is mergeable on its own merits and doesn't depend on brand-level decisions. Happy to split it out as a separate, smaller PR if preferred.
What this PR currently changes (full-proposal version)
user_guide_src/source/_static/css/citheme.css@font-faceblocks with 10 local@font-faceblocks for Inter (6 variants) + JetBrains Mono (4 variants), sourcing.woff2only (no legacy.eot/.svg/.ttf/.woff). Each block declaresunicode-rangefor the latin subset andfont-display: swap.body/p/legend/h1–h6font-familyfrom"Raleway", ...to"Inter", ....font-feature-settings: "calt" 1;to make ligature intent explicit.user_guide_src/source/_static/fonts/Raleway/— deleted (30 files, ~1.1 MB).user_guide_src/source/_static/fonts/Inter/— added (6.woff2files, ~148 KB).user_guide_src/source/_static/fonts/JetBrainsMono/— added (4.woff2files, ~88 KB).Questions for maintainers
Is there a preference for self-hosted fonts over a Google Fonts CDN dependency?Addressed — self-hosted after @neznaika0 raised CDN-reachability concerns in review. Files ship as latin-subset.woff2underuser_guide_src/source/_static/fonts/.codeigniter4projects/websitebe welcome, or is that repo's typography considered separate?Drafted with assistance from Claude (Anthropic). All factual claims verified against primary sources.
Checklist: