← Back to Pull requests

docs: propose modernizing user guide typography #10133

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Apr 23, 2026 12:24 UTC
Author

<!--

Each pull request should address a single issue and have a meaningful title.

  • PR title must include the type (feat, fix, chore, docs, perf, refactor, style, test) of the commit per Conventional Commits specification. See https://www.conventionalcommits.org/en/v1.0.0/ for the discussion.

  • Pull requests must be in English.

  • If a pull request fixes an issue, reference the issue with a suitable keyword (e.g., Fixes <issue number>).

  • Your branch name and the target name should be different.

  • All bug fixes should be sent to the __"develop"__ branch, this is where the next bug fix version will be developed.

  • PRs with any enhancement should be sent to the next minor version branch.
  • -->
    Description

    Note on scope: This is a discussion/RFC-style PR, not a drop-in merge. The user guide's font is tied to CodeIgniter's brand typography — Raleway is also in active use on codeigniter.com — so landing this in isolation would create a visible divergence between the marketing site and the docs. The purpose here is to make the case, propose a coordinated change, and open the conversation. A sibling PR will be drafted against codeigniter4projects/website so both surfaces can move together. If the project prefers to keep Raleway for brand reasons, there is a scoped-down Plan B near the bottom that can ship independently.

    Background

    The user guide currently bundles Raleway locally (6 @font-face blocks in user_guide_src/source/_static/css/citheme.css, and 30 font files totaling ~1.1 MB under user_guide_src/source/_static/fonts/Raleway/). That setup dates to February 2020, commit a57d141 ("Change font to 'Raleway' (CI's 'official' font)"), followed by a short stabilization series ending with 80ec0c0. It has not been revisited in ~6 years.

    Verified that codeigniter4projects/website currently ships the identical Raleway bundle in public/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:

    1. Raleway is a display typeface — not optimized for long-form reading. Designed by Matt McInerney in 2010 as a single ExtraLight weight for headlines, later expanded into a family. The bundled 200 weight in particular renders thin and low-contrast on modern high-DPI displays at body sizes. Readers going through long API reference pages aren't getting the best legibility we could offer.
    2. The local bundle ships formats for browsers that no longer exist. The 30 files include .eot (IE 6–9 — Microsoft retired IE in June 2022) and .svg fonts (pre-iOS 4.2 Safari). Modern browsers all use .woff2. The legacy formats are dead weight in every clone, CI job, and release.
    3. Code blocks have no intentional font. The RTD theme falls back to 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 calt ligatures 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 .woff2 files totaling ~252 KB, under user_guide_src/source/_static/fonts/Inter/ (6 variants) and user_guide_src/source/_static/fonts/JetBrainsMono/ (4 variants). Each @font-face declares unicode-range for the latin subset so glyphs outside the range fall back cleanly to system fonts, and uses font-display: swap so 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/website touching public/assets/css/ci-theme.css and public/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:

  • Keep Raleway for body and headings exactly as today.

  • Add JetBrains Mono (or Fira Code) for <pre> and <code> self-hosted as .woff2 — no brand conflict, high dev-facing value.

  • Add high-specificity monospace selectors (.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.

  • Optionally remove the legacy .eot and .svg files 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

  • - Replaced 6 local Raleway @font-face blocks with 10 local @font-face blocks for Inter (6 variants) + JetBrains Mono (4 variants), sourcing .woff2 only (no legacy .eot/.svg/.ttf/.woff). Each block declares unicode-range for the latin subset and font-display: swap.
    - Updated body / p / legend / h1–h6 font-family from "Raleway", ... to "Inter", ....
    - Added a monospace rule targeting RTD's high-specificity selectors so JetBrains Mono wins the cascade on syntax-highlighted blocks.
    - Added 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 .woff2 files, ~148 KB).

  • user_guide_src/source/_static/fonts/JetBrainsMono/ — added (4 .woff2 files, ~88 KB).
  • Questions for maintainers

    1. Is Raleway still considered the project's brand typeface? If yes, is the Foundation open to revisiting that? (Decisive question — everything downstream hangs on it.)
    2. ~~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 .woff2 under user_guide_src/source/_static/fonts/.
    3. Would a coordinated PR at codeigniter4projects/website be welcome, or is that repo's typography considered separate?
    4. If the full change isn't on the table, is Plan B (code font only) acceptable as a standalone PR?

    ---

    <sub>_Drafted with assistance from Claude (Anthropic). All factual claims verified against primary sources._</sub>

    Checklist:

  • Securely signed commits

  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)

  • Unit testing, with >80% coverage

  • User guide updated

  • Conforms to style guide
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: neznaika0 Review duration: 235604m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.59) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.59 · 650 lines diff across 8 files
    0.59
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #10133"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 59% (MEDIUM) · Higher = larger blast radius
    59%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 32.6% · Safe to merge
    32.6%