Skip to content

Releases: QuantEcon/quantecon-book-theme

v0.20.3

13 Apr 23:33

Choose a tag to compare

Fix h5 heading size hierarchy

Fixed

  • h5 headings appearing larger than h4 (#381) — h5 had no dedicated CSS rule, so it inherited the browser default size and "PT Serif" (a visually larger serif font) while h4 used the more compact "Source Sans Pro" at 1.2rem. Added explicit h5 styling (1rem, Source Sans Pro, weight 900) to restore the correct heading size hierarchy.

CI

  • Bump actions/github-script from 8 to 9 (#380)
  • Bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0 (#379)

v0.20.2

06 Apr 02:59

Choose a tag to compare

Fix emphasis color on textual citation "et al." text

Fixed

  • Emphasis color on "et al." in textual citations (#378) — the v0.20.1 fix only targeted <em> inside <a class="reference"> links. With bibtex_reference_style: author_year, sphinxcontrib-bibtex places <em>et al.</em> as a sibling of the link, not a child. Added span:has(> a.reference) > em CSS selector to handle this structure across all theme variants (light, dark, gruvbox).

v0.20.1

06 Apr 01:39

Choose a tag to compare

Fix emphasis color on citation reference links

Fixed

  • Emphasis color applied to "et al." in citation links (#366) — added a.reference em CSS overrides so <em> tags inside sphinxcontrib-bibtex citation reference links inherit color and font-weight from the parent anchor instead of the theme's emphasis styling. Applied across light, dark, and gruvbox color schemes.

Changed

  • Relaxed sphinxcontrib-bibtex upper bound (#366) — updated docs dependency from <=2.5.0 to <3, allowing compatibility with the 2.6.x series (latest 2.6.5).

CI

  • Bump codecov/codecov-action from 5.5.2 to 6.0.0 (#377)
  • Bump actions/deploy-pages from 4 to 5 (#376)

v0.20.0

23 Mar 03:37

Choose a tag to compare

Language Switcher for Multilingual Site Support

What's New

Language Switcher for Multilingual Sites

A new globe icon dropdown in the bottom toolbar enables users to switch between translated versions of a lecture site. The switcher:

  • Only renders when 2+ languages are configured via html_theme_options
  • Supports keyboard navigation, click-outside-to-close, and dark mode
  • Is fully accessible with ARIA roles and labels
  • Has zero impact on existing sites (no configuration required)

SEO hreflang Tags

Automatically injects <link rel="alternate" hreflang="..."> meta tags in <head> for all configured languages, improving search engine discovery of translated content.

Configuration Example

sphinx:
  config:
    html_theme_options:
      languages:
        - code: en
          name: English
          url: https://python-programming.quantecon.org
        - code: fa
          name: فارسی
          url: https://quantecon.github.io/lecture-python-programming.fa
        - code: zh-cn
          name: 中文
          url: https://quantecon.github.io/lecture-python-programming.zh-cn
      current_language: en

Infrastructure Documentation

New developer guide covering three hosting options (GitHub Pages, subdomains, reverse proxy) for deploying translated lecture sites.

Other Changes

  • Renamed lecture-python-programming.myst to lecture-python-programming across CI workflows, tox config, Playwright config, and documentation.

Full Changelog: v0.19.0...v0.20.0

v0.19.0

08 Mar 05:04

Choose a tag to compare

myst-nb 1.4+ compatibility and inline code styling

What's Changed

Changed

  • sticky_contents now defaults to True (#371) — the sticky right-hand table of contents with scroll spy is now enabled by default. To revert, set sticky_contents: False in html_theme_options.
  • Increased CSS specificity for custom code highlighting (#373) — ensures custom token colors are not overridden by pydata-sphinx-theme's Pygments rules.

Added

  • data-theme attribute on <html> (#373) — sets the standard data-theme attribute for compatibility with myst-nb 1.4.0+. Resolves dark code cell backgrounds appearing on light-themed sites for users with OS dark mode enabled.
  • inline_literal_box theme option (#373) — controls whether inline code literals display with background box/border styling (default: False).
  • --qe-literal-color CSS variable (#373) — inline code literal color integrated into the text color scheme system:
    • Seoul256: #af5f5f (muted rust) / #d78787 (soft rose dark)
    • Gruvbox: #9d0006 (dark red) / #fb4934 (bright red dark)
    • None: inherits text color

Fixed

  • Dark code cells with myst-nb 1.4+ (#373) — fixed myst-nb 1.4.0 falling through to OS preference for dark mode detection.

CI

  • Bump actions/upload-pages-artifact from 3 to 4 (#370)
  • Bump actions/upload-artifact from 6 to 7 (#369)

Full Changelog: v0.18.0...v0.19.0

v0.18.0

23 Feb 22:20

Choose a tag to compare

Dark Theme Overhaul

What's Changed

Complete Dark Theme Overhaul (#365)

A ground-up rewrite of the dark theme for a modern, consistent, and readable experience.

Changed

  • Replaced ad-hoc grays (#222/#333/#444) with a cohesive navy-charcoal palette (#1a1a2e background, #252540 surfaces, #d4d4e4 text, #6cb6ff links)
  • Images now use subtle opacity reduction instead of aggressive CSS inversion
  • CSS custom properties — all 16 palette colors declared as overridable --qe-dark-* custom properties; downstream projects can now customize colors without duplicating selectors

Added

  • Dark mode syntax highlighting — complete token colors for all ~40 Pygments syntax classes using a VS Code Dark+ inspired palette
  • FOUC prevention — early inline script applies dark mode class before first paint, eliminating the flash of white on page load
  • Dark mode documentation — new "Dark Mode" section in configure.md covering palette, syntax highlighting, admonitions, image handling, and CSS customization with full reference table of all overridable custom properties
  • Dark mode coverage for unstyled elements — modals, admonitions (type-specific accents), homepage elements, collapse/toggle bars, tooltips, autodoc, footnotes, and non-QuantEcon project overrides

Fixed

  • Double logo in dark theme — when a dedicated dark logo is configured, both light and dark logos were shown
  • Page header unreadable in dark mode — title link, authors, "Last changed" button, and changelog dropdown used #444 text on dark backgrounds
  • Unreadable table text in dark mode — table rows used #333 text on dark backgrounds
  • Indistinguishable links in dark mode — all links were #fff, same as body text
  • Inline code light border in dark mode — code spans retained light-theme borders
  • Sidebar search white in dark mode — search input area remained white
  • Toolbar border in dark mode — toolbar border remained light gray
  • Syntax highlighting gaps — only 3 of ~40 token types had dark mode overrides
  • Stderr warnings in dark mode — updated to use amber accents matching the new palette

Full Changelog: v0.17.1...v0.18.0

v0.17.1

19 Feb 06:07

Choose a tag to compare

Bug Fixes

Fixed

  • Horizontal scrollbar on sticky TOC (#363) — added overflow-x: hidden to the sticky "On this page" sidebar to prevent an unwanted horizontal scrollbar when long section titles wrap
  • npm security vulnerabilities (#364) — resolved 9 dependency vulnerabilities (5 high, 3 moderate, 1 low) via npm audit fix, updating webpack, node-forge, qs, lodash, cross-spawn, ajv, and nanoid

v0.17.0

19 Feb 05:18

Choose a tag to compare

Sticky TOC & Color Scheme System

Breaking Changes

  • Removed individual color optionsemphasis_color, emphasis_color_dark, strong_color, strong_color_dark, definition_color, definition_color_dark have been replaced by the new color_scheme option. Migrate to the built-in seoul256 scheme or a custom_color_scheme.css file.

Added

  • Sticky table of contents with scroll highlighting (#350, #133)
    • sticky_contents option enables a fixed-position RHS TOC that tracks scroll position
    • Scroll spy highlights the currently visible section
    • Auto-expand subsections show the active hierarchy (contents_autoexpand)
    • Copy section link: hover over any TOC entry to copy the full URL with anchor
    • Back to top button appears after scrolling down 300px
    • New scrollspy.js module with requestAnimationFrame throttling
  • CI: /update-snapshots command (#362) for regenerating Playwright visual baselines

Changed

  • Text color scheme system (#360) — new color_scheme theme option (seoul256, gruvbox, none)
    • Seoul256 palette: dark teal/dark amber (light), medium-light teal/light amber-gold (dark)
    • Gruvbox palette: earthy aqua/warm orange (light), light aqua/bright orange (dark)
    • Custom override via custom_color_scheme.css in project _static/

Fixed

  • Math equation visual test stability (#361) — regenerated stale snapshots, increased tolerance

Full Changelog: v0.16.0...v0.17.0

v0.16.0

06 Feb 04:30

Choose a tag to compare

Customizable Emphasis and Bold Text Colors

What's New

Customizable Emphasis and Bold Text Colors (#355, #356)

Six new html_theme_options allow per-site color customization of typography elements:

  • emphasis_color / emphasis_color_dark — italic (<em>) text
  • strong_color / strong_color_dark — bold (<strong>/<b>) text
  • definition_color / definition_color_dark — definition list (<dt>) elements

Each supports light and dark mode independently, with CSS custom properties and SCSS fallbacks. Server-side validation prevents CSS injection.

Example configuration:

html_theme_options = {
    "emphasis_color": "#d9534f",
    "strong_color": "#0056b3",
    "definition_color": "#2e7d32",
}

See the configuration docs for full details.

Bug Fixes

  • Math equation visual test stability (#357) — replaced fixed timeout with MathJax.startup.promise for reliable rendering detection
  • Update-snapshots workflow — added continue-on-error to handle missing snapshot exits gracefully

Dependency Updates

  • Bump codecov/codecov-action from 5.5.1 to 5.5.2 (#351)
  • Bump actions/upload-artifact from 5 to 6 (#352)

Full Changelog: v0.15.1...v0.16.0

v0.15.1

10 Dec 22:53

Choose a tag to compare

Fixed

  • Notebook launch URLs with path_to_docs (#345)
    • Fixed bug where path_to_docs prefix was incorrectly included in notebook URLs
    • When docs are in a subdirectory (e.g., lectures/) but notebooks are in a flat repo structure, launch buttons (Colab, JupyterHub, Binder) now generate correct URLs
    • Added comprehensive test coverage including backward compatibility tests
  • Visual regression test stability (#350)
    • Fixed flaky MathJax visual regression test by using maxDiffPixels instead of maxDiffPixelRatio
    • Handles minor rendering variations across different environments

Changed

  • Dependency updates (Dependabot)
    • Bump actions/github-script from 7 to 8 (#348)
    • Bump actions/upload-artifact from 4 to 5 (#347)
    • Bump actions/setup-node from 4 to 6 (#346)