Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6a5f30c
docs(style[toc,body]): refine right-panel TOC and body typography
tony Mar 14, 2026
b85cb5a
docs(style[toc,content]): flexible TOC width with inner-panel padding
tony Mar 14, 2026
a412604
docs(style[toc]): increase TOC font size from 81.25% to 87.5%
tony Mar 14, 2026
693a880
docs(style[headings]): refine heading hierarchy — scale, spacing, eye…
tony Mar 14, 2026
9c45202
docs(fonts): self-host IBM Plex via Fontsource CDN
tony Mar 14, 2026
98d2e0f
docs(fonts[css]): fix variable specificity — use body instead of :root
tony Mar 14, 2026
2c560c4
docs(fonts[preload]): add <link rel="preload"> for critical font weights
tony Mar 14, 2026
b9e8b6f
docs(fonts[css]): add kerning, ligatures, and code rendering overrides
tony Mar 14, 2026
f83b0cb
docs(images[cls]): prevent layout shift and add non-blocking loading
tony Mar 14, 2026
b3a0481
docs(nav[spa]): add SPA-like navigation to avoid full page reloads
tony Mar 14, 2026
ccab059
docs(fonts[fallback]): add fallback font metrics to eliminate FOUT re…
tony Mar 14, 2026
36ead8f
docs(images[badges]): add placeholder sizing for external badge images
tony Mar 14, 2026
c67cb99
docs(sidebar[projects]): prevent active link flash with visibility gate
tony Mar 14, 2026
006a281
docs(nav[spa]): wrap DOM swap in View Transitions API for smooth cros…
tony Mar 14, 2026
7fede09
docs(css[structure]): move view transitions section after image rules
tony Mar 14, 2026
0fa6520
docs(fonts[loading]): switch to font-display block with inline CSS
tony Mar 14, 2026
f128bf2
docs(fonts[lint]): add docstrings to sphinx_fonts extension
tony Mar 14, 2026
09b5b2f
test(docs[sphinx_fonts]): add tests for sphinx_fonts extension
tony Mar 14, 2026
5d37f93
test(docs[sphinx_fonts]): fix ruff lint errors in test_sphinx_fonts
tony Mar 14, 2026
2e5f1ad
test(docs[sphinx_fonts]): apply ruff format to test_sphinx_fonts
tony Mar 14, 2026
2f458a7
test(docs[sphinx_fonts]): fix mypy errors in test_sphinx_fonts
tony Mar 14, 2026
8def325
pyproject(mypy): add sphinx_fonts to ignore_missing_imports
tony Mar 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(images[cls]): prevent layout shift and add non-blocking loading
why: Every <img> on the docs site lacked dimension hints, causing
Cumulative Layout Shift (CLS) on page load.
what:
- Add content-visibility: auto on all img for off-screen decode skip
- Add height: auto !important for lazy-loaded images with aspect-ratio
- Add CSS height: 20px for shields.io / badge / codecov badges
- Add sidebar/brand.html with width/height/decoding on logo
  • Loading branch information
tony committed Mar 14, 2026
commit f83b0cb012216e9f7548135177aac3897b559cb5
28 changes: 28 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,31 @@ samp {
article {
line-height: 1.6;
}

/* ── Image layout shift prevention ────────────────────────
* Reserve space for images before they load. Furo already
* sets max-width: 100%; height: auto on img. We add
* content-visibility and badge-specific height to prevent CLS.
* ────────────────────────────────────────────────────────── */

img {
content-visibility: auto;
}

/* Docutils emits :width:/:height: as inline CSS (style="width: Xpx;
* height: Ypx;") rather than HTML attributes. When Furo's
* max-width: 100% constrains width below the declared value,
* the fixed height causes distortion. height: auto + aspect-ratio
* lets the browser compute the correct height from the intrinsic
* ratio once loaded; before load, aspect-ratio reserves space
* at the intended proportion — preventing both CLS and distortion. */
article img[loading="lazy"] {
height: auto !important;
}

img[src*="shields.io"],
img[src*="badge.svg"],
img[src*="codecov.io"] {
height: 20px;
width: auto;
}
18 changes: 18 additions & 0 deletions docs/_templates/sidebar/brand.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<a class="sidebar-brand{% if logo %} centered{% endif %}" href="{{ pathto(master_doc) }}">
{%- block brand_content %}
{%- if logo_url %}
<div class="sidebar-logo-container">
<img class="sidebar-logo" src="{{ logo_url }}" width="200" height="200" decoding="async" alt="Logo"/>
</div>
{%- endif %}
{%- if theme_light_logo and theme_dark_logo %}
<div class="sidebar-logo-container">
<img class="sidebar-logo only-light" src="{{ pathto('_static/' + theme_light_logo, 1) }}" width="200" height="200" decoding="async" alt="Light Logo"/>
<img class="sidebar-logo only-dark" src="{{ pathto('_static/' + theme_dark_logo, 1) }}" width="200" height="200" decoding="async" alt="Dark Logo"/>
</div>
{%- endif %}
{% if not theme_sidebar_hide_name %}
<span class="sidebar-brand-text">{{ docstitle if docstitle else project }}</span>
{%- endif %}
{% endblock brand_content %}
</a>