Skip to content

DOC: Section heading font sizes should be smaller in pydata-sphinx-theme #15112

Open

Description

@pllim

As @dhomeier comment in #14867 (comment) , "Section headings font sizes indeed seem quite excessive, so there probably is some fine-tuning to be done in the follow-up."

But we also need to make sure this is actually a common problem across different platforms and browsers before trying to fix it. You don't want to adjust it to look pretty on someone's PC only to make it worse for someone else.

Most section heading levels are inherited from the old theme, so I think modifying the CSS rather than changing the RST would probably be less disruptive.

Activity

  1. pllim commented on Oct 29, 2024

    @pllim
    MemberAuthor

    I think the default font sizes are here:

    https://github.com/pydata/pydata-sphinx-theme/blob/main/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss

    Particularly:

      // base font size - applied at body/html level
      --pst-font-size-base: 1rem;
    
      // heading font sizes based on a medium contrast type scale
      // - see: https://github.com/Quansight-Labs/czi-scientific-python-mgmt/issues/97#issuecomment-2310531483
      --pst-font-size-h1: 2.625rem;
      --pst-font-size-h2: 2.125rem;
      --pst-font-size-h3: 1.75rem;
      --pst-font-size-h4: 1.5rem;
      --pst-font-size-h5: 1.25rem;
      --pst-font-size-h6: 1rem;

    But, I don't see NumPy changing these at https://github.com/numpy/numpy/blob/main/doc/source/_static/numpy.css . What I noticed is that they used double # (https://raw.githubusercontent.com/numpy/numpy/refs/heads/main/doc/source/user/index.rst) heading level when we use double * level (https://raw.githubusercontent.com/astropy/astropy/refs/heads/main/docs/index_user_docs.rst) . Surprisingly, according to https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#sections , # is actually supposed to be larger than *. So maybe this from NumPy setting would help? 🤷‍♀️

    body {
      font-family: 'Open Sans', sans-serif;
      font-size: medium;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions