From 157c9ab2c93e755141e48d13b5f193c6169d9dd8 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Fri, 24 Feb 2023 18:28:42 +0100 Subject: [PATCH] Make heading-style use the font-weight-heading value (#1213) * Make heading-style use the font-weight-heading value * Separate font-weight setting for content headers and admonitions * Flip var to be consistent with --pst-font-weight-heading instead --- src/pydata_sphinx_theme/assets/styles/base/_base.scss | 2 +- .../assets/styles/components/_prev-next.scss | 2 +- .../assets/styles/components/_readthedocs-switcher.scss | 2 +- .../assets/styles/content/_admonitions.scss | 4 ++-- src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss | 5 ++++- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pydata_sphinx_theme/assets/styles/base/_base.scss b/src/pydata_sphinx_theme/assets/styles/base/_base.scss index 3791f42fc..59a41f737 100644 --- a/src/pydata_sphinx_theme/assets/styles/base/_base.scss +++ b/src/pydata_sphinx_theme/assets/styles/base/_base.scss @@ -85,7 +85,7 @@ a { .heading-style { margin: 2.75rem 0 1.05rem; font-family: var(--pst-font-family-heading); - font-weight: 400; + font-weight: var(--pst-font-weight-heading); line-height: 1.15; } diff --git a/src/pydata_sphinx_theme/assets/styles/components/_prev-next.scss b/src/pydata_sphinx_theme/assets/styles/components/_prev-next.scss index afdfc6704..eedb93511 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_prev-next.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_prev-next.scss @@ -24,7 +24,7 @@ p.prev-next-title { color: var(--pst-color-primary); - font-weight: var(--pst-font-weight-heading); + font-weight: var(--pst-admonition-font-weight-heading); font-size: 1.1em; } diff --git a/src/pydata_sphinx_theme/assets/styles/components/_readthedocs-switcher.scss b/src/pydata_sphinx_theme/assets/styles/components/_readthedocs-switcher.scss index bfc3f4892..8e9bb83dc 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_readthedocs-switcher.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_readthedocs-switcher.scss @@ -28,7 +28,7 @@ color: var(--pst-color-text-base); content: "Read The Docs"; font-family: var(--pst-font-family-base); - font-weight: var(--pst-font-weight-heading); + font-weight: var(--pst-admonition-font-weight-heading); } } .fa.fa-caret-down { diff --git a/src/pydata_sphinx_theme/assets/styles/content/_admonitions.scss b/src/pydata_sphinx_theme/assets/styles/content/_admonitions.scss index 325ac5ec6..0b38eecdd 100644 --- a/src/pydata_sphinx_theme/assets/styles/content/_admonitions.scss +++ b/src/pydata_sphinx_theme/assets/styles/content/_admonitions.scss @@ -36,7 +36,7 @@ div.admonition, > .admonition-title { margin: 0 -0.6rem; padding: 0.4rem 0.6rem 0.4rem 2rem; - font-weight: var(--pst-font-weight-heading); + font-weight: var(--pst-admonition-font-weight-heading); position: relative; &:after { @@ -320,7 +320,7 @@ aside.sidebar { padding-bottom: 0.5rem; border-bottom: 1px solid var(--pst-color-border); font-family: var(--pst-font-family-heading); - font-weight: var(--pst-font-weight-heading); + font-weight: var(--pst-admonition-font-weight-heading); } // Add margin to the first non-`.sidebar-title` item diff --git a/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss b/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss index 334d7b871..3c435e69c 100644 --- a/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss +++ b/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss @@ -23,9 +23,12 @@ html { --pst-sidebar-header-font-size: 1.2rem; --pst-sidebar-header-font-weight: 600; + // Admonition styles + --pst-admonition-font-weight-heading: 600; + // Font weights --pst-font-weight-caption: 300; - --pst-font-weight-heading: 600; + --pst-font-weight-heading: 400; // Font family // These are adapted from https://systemfontstack.com/ */