Repository navigation
Switch the docs theme to Furo (proof of concept) - #603
Draft
honzajavorek wants to merge 12 commits into
Draft
honzajavorek wants to merge 12 commits into
honzajavorek wants to merge 12 commits into
Conversation
- Illustrations and the logo are plain black SVGs, inverted with CSS in dark mode, so they follow both the system setting and Furo's toggle. The white org-i.svg logo is no longer needed. - Brand colours from pyvec.org, adjusted for WCAG AA contrast. - Keep Furo's default code highlighting. - Drop the old blockquote and image margin CSS, keep only what Furo needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
honzajavorek
force-pushed
the
honzajavorek/furo
branch
from
November 5, 2026 09:54
87c6933 to
9ba83c1
Compare
Sphinx puts the image class on the wrapping link too, so the invert filter applied twice and the illustrations came out dark grey. Target only the img, so they match the logo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The light sidebar was plain grey with barely any brand colour. Use the slate from the pyvec.org header, with Pyvec blue links. The logo is now always on slate, so it is always inverted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Furo does not style ::selection, so on a light page with the OS in dark mode, browsers used a dark blue selection and text became unreadable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unreadable selection came from Furo not declaring color-scheme, so browsers used the OS dark-mode selection on light pages. Declaring the active scheme lets the browser pick fitting native colours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audited all 26 pages in light and dark mode with axe-core (WCAG AA, 4.5:1 for text). Fixes: - Dark mode greys and visited links were below 4.5:1 on the slate backgrounds. Use slate-tinted greys and a lighter visited purple. - Admonitions in dark mode used Furo's near-black background, which clashed with slate. Use slate. - The search placeholder used the browser's default grey (about 2.6:1 on slate). Use the search icon colour (5.8:1). - Furo shows `.. contents::` in red with an error message, and links in it had 3:1 contrast. Remove the ones that only duplicate "On this page". Keep the two that are part of the text, using Furo's opt-out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Sphinx centres tables without :align:, and Furo keeps that, unlike sphinx_rtd_theme. Align them left like the rest of the text. - A titled `.. contents::` renders as a teal topic box with a pencil icon in Furo. Use a plain sentence before the list instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In this file the <style> was on the same line as <svg>, so removing the <style> line also removed the root element and broke the image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New pyvec_docs.ext.image_dimensions adds width and height attributes, read from the viewBox, to SVG images in the HTML. Browsers use them as the aspect ratio before the image loads. The displayed size still comes from :width: and CSS. - Furo's logo has no dimensions, so give it the aspect ratio of org.svg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The panel used #2980b9 from sphinx_rtd_theme. Use the brand blue the docs use for links in light mode, #0079b3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
og-image.svg is the source, og-image.png is exported from it by hand with Inkscape. The PNG is regenerated with the documented command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proof of concept for #590. It swaps
sphinx_rtd_theme, which is no longer developed, for Furo. Furo has dark mode built in: it follows the system setting and has a toggle.Honza's decisions
custom.cssonly for things we actually don't like in the theme, so the old blockquote and image margin rules are gone.monokai, unless we decide we don't like it.Changes
pyproject.toml/uv.lock: replacesphinx-rtd-themewithfuro.docs/conf.py:html_theme = "furo", withhtml_titleset to the project name.source_repository.#0097df, slate#232f36and#3b4f5a. Furo uses the brand colour for link text, and#0097dfon white is only 3.2:1, so the blues are adjusted to pass WCAG AA. Light mode uses#0079b3on white backgrounds. Dark mode uses#33b1econ slate backgrounds.#232f36, the pyvec.org header) in both light and dark mode, with#33b1eclinks. Every text colour in it passes WCAG AA, including on hover.#aab8c0secondary,#909ca4muted) and a lighter visited purple (#bb8aee). Furo's greys and purple fell below 4.5:1 on the slate backgrounds.prefers-color-scheme<style>is gone, which also supersedes Prefer black even for dark mode (for now, until we have dark mode) #464. In dark mode,custom.cssinverts them to#ccc. It uses the same selectors Furo uses for its own colours:body[data-theme="dark"], plus the system setting when the toggle is on "auto". The rule targets onlyimg, because Sphinx also puts the class on the wrapping link, and the filter would otherwise apply twice and make the illustrations look dim. Illustrations opt in with:class: adaptive-image. The logo is a single image (org.svg). The sidebar is always slate, so the logo is always inverted to#ccc, and the whiteorg-i.svgis deleted.custom.cssno longer has the old blockquote and image margin rules. It has only:overflow-wrap: break-wordbroke mid-word ("česk / é");color-schemematching Furo's active theme (the sidebar is alwaysdark). Furo doesn't declare it, so browsers followed the OS. On a light page with the OS in dark mode, the native text selection was dark blue and unreadable. Now the browser and OS pick native selection colours that fit the page, with no colours of our own. Selected blue links on the dark-mode selection are readable but weaker; that's the browser's choice.:align:, and Furo keeps that (sphinx_rtd_theme overrode it)... contents::directives (bylaws, runbooks, Twitter, the top of financial support). Furo shows them in red with an "ERROR: … unnecessary" message, because its "On this page" panel already lists the sections. Their links were also only 3:1 on the red. Two lists stay, because they're part of the text ("Poskytujeme tyto hlavní služby:" and "Oblasti podpory"). They use Furo's opt-out class, so they render as normal lists. Furo turns a titledcontentsinto a teal box with a pencil icon, so the "Oblasti podpory" title is now a plain sentence before the list.pyvec_docs.ext.image_dimensionsextension: it addswidthandheight, read from theviewBox, to SVG<img>tags. Browsers then reserve space for illustrations before they load (before this, the content below jumped by up to 265 px). The displayed size still comes from:width:and CSS. It has unit tests.#2980b9, the old sphinx_rtd_theme blue. It's now#0079b3, the docs' light-mode brand blue, inog-image.svg, the source, and inog-image.png, exported from it.CONTRIBUTING.rsthas a new section on exporting the PNG by hand with Inkscape, including the Inter Display Bold font it needs. The committed PNG was produced with exactly that command. Inkscape re-renders the original PNG to within 2/255 per pixel, so only the colour changed.ukulele.svg. Removing its<style>also removed its opening<svg>tag, because they were on one line, so the image was broken in earlier previews of this PR.docs/_templates/page.html: no changes needed. Furo provides thehtmltitleandextraheadblocks, and the built pages still have the custom<title>and theog:imagetags.Testing
sphinx-build -Wandpytestpass.🤖 Generated with Claude Code