From fb934f64b625ccdb930d7bb6a5cd4d3d64c82bc9 Mon Sep 17 00:00:00 2001 From: 12rambau Date: Mon, 23 Jan 2023 15:21:14 +0100 Subject: [PATCH 1/6] remove fix secodary size --- .../assets/styles/components/_toc-inpage.scss | 4 ---- .../assets/styles/sections/_sidebar-secondary.scss | 10 +++++++++- .../assets/styles/variables/_fonts.scss | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/pydata_sphinx_theme/assets/styles/components/_toc-inpage.scss b/src/pydata_sphinx_theme/assets/styles/components/_toc-inpage.scss index e5a3cff34..4c2a200d6 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_toc-inpage.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_toc-inpage.scss @@ -4,10 +4,6 @@ nav.page-toc { // A little extra space before the buttons margin-bottom: 1rem; - // Each successive nested item will be a bit smaller - ul > li { - font-size: 0.95em; - } } .bd-toc .nav, diff --git a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-secondary.scss b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-secondary.scss index c604accc2..747e85b7f 100644 --- a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-secondary.scss +++ b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-secondary.scss @@ -13,7 +13,15 @@ font-size: var(--pst-sidebar-font-size-mobile); @include media-breakpoint-up($breakpoint-sidebar-secondary) { - font-size: var(--pst-sidebar-secondary-font-size); + font-size: var(--pst-sidebar-font-size); + } + + // override bootstrap settings + .nav-link { + font-size: var(--pst-sidebar-font-size-mobile); + @include media-breakpoint-up($breakpoint-sidebar-secondary) { + font-size: var(--pst-sidebar-font-size); + } } padding: 2rem 1rem 1rem 1rem; diff --git a/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss b/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss index b06c648a9..d56e8f8e0 100644 --- a/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss +++ b/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss @@ -18,9 +18,9 @@ html { --pst-font-size-milli: 12px; // Sidebar styles - --pst-sidebar-font-size: 0.9em; - --pst-sidebar-font-size-mobile: 1.2em; - --pst-sidebar-header-font-size: 1.2em; + --pst-sidebar-font-size: 0.9rem; + --pst-sidebar-font-size-mobile: 1.2rem; + --pst-sidebar-header-font-size: 1.2rem; --pst-sidebar-header-font-weight: 600; // Font weights From cb51fe8e0dbbcac568102b08cc207b1ce9903a30 Mon Sep 17 00:00:00 2001 From: 12rambau Date: Mon, 23 Jan 2023 15:34:01 +0100 Subject: [PATCH 2/6] use same var for all links in primary sidebar --- .../assets/styles/sections/_sidebar-primary.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss index 39d54ff5f..27cbf3c7a 100644 --- a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss +++ b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss @@ -24,6 +24,11 @@ font-size: var(--pst-sidebar-font-size); } + // override bootstrap when navlink are displayed in the sidebar + .nav-link { + font-size: var(--pst-sidebar-font-size-mobile); + } + &.no-sidebar { border-right: 0; } From 4464e4283f03a2715101c52552f8a69981b31bdd Mon Sep 17 00:00:00 2001 From: 12rambau Date: Mon, 23 Jan 2023 15:41:31 +0100 Subject: [PATCH 3/6] use sidebar size for toctree caption --- .../assets/styles/sections/_sidebar-primary.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss index 27cbf3c7a..12b00401e 100644 --- a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss +++ b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss @@ -216,6 +216,7 @@ nav.bd-links { // Toctree captions p.caption { + font-size: var(--pst-sidebar-font-size); font-weight: var(--pst-sidebar-header-font-weight); position: relative; margin-top: 1.25em; From 8e26204dbc7f1fa4df2b0893b305a618f356eaa4 Mon Sep 17 00:00:00 2001 From: 12rambau Date: Mon, 23 Jan 2023 16:00:03 +0100 Subject: [PATCH 4/6] fix: use rem for all fonts --- .../assets/styles/variables/_fonts.scss | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss b/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss index d56e8f8e0..db792ce5b 100644 --- a/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss +++ b/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss @@ -4,18 +4,18 @@ html { */ // base font size - applied at body/html level - --pst-font-size-base: 15px; + --pst-font-size-base: 1rem; - // heading font sizes - --pst-font-size-h1: 36px; - --pst-font-size-h2: 32px; - --pst-font-size-h3: 26px; - --pst-font-size-h4: 21px; - --pst-font-size-h5: 18px; - --pst-font-size-h6: 16px; + // heading font sizes based on bootstrap sizing + --pst-font-size-h1: 2.5rem; + --pst-font-size-h2: 2rem; + --pst-font-size-h3: 1.75rem; + --pst-font-size-h4: 1.5rem; + --pst-font-size-h5: 1.25rem; + --pst-font-size-h6: 1.1rem; // smaller than heading font sizes - --pst-font-size-milli: 12px; + --pst-font-size-milli: 0.9rem; // Sidebar styles --pst-sidebar-font-size: 0.9rem; From 999193369b484ddcb99914f21907c1b321f74e8f Mon Sep 17 00:00:00 2001 From: 12rambau Date: Mon, 23 Jan 2023 17:01:52 +0100 Subject: [PATCH 5/6] fix: use same margin in primary and secondary sidebar --- .../assets/styles/sections/_sidebar-primary.scss | 4 ++-- .../assets/styles/sections/_sidebar-secondary.scss | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss index 12b00401e..4a4c2293d 100644 --- a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss +++ b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss @@ -219,8 +219,8 @@ nav.bd-links { font-size: var(--pst-sidebar-font-size); font-weight: var(--pst-sidebar-header-font-weight); position: relative; - margin-top: 1.25em; - margin-bottom: 0.5em; + margin-top: 1.25rem; + margin-bottom: 0.5rem; color: var(--pst-color-text-base); &:first-child { margin-top: 0; diff --git a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-secondary.scss b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-secondary.scss index 747e85b7f..5b1333dc5 100644 --- a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-secondary.scss +++ b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-secondary.scss @@ -34,6 +34,7 @@ .onthispage { color: var(--pst-color-text-base); font-weight: var(--pst-sidebar-header-font-weight); + margin-bottom: 0.5rem; } @include scrollbar-style(); From 57a505f06ab59764c06d5f1302acef316150be44 Mon Sep 17 00:00:00 2001 From: 12rambau Date: Mon, 23 Jan 2023 18:26:57 +0100 Subject: [PATCH 6/6] fix section font side in primary sidebar --- .../assets/styles/sections/_sidebar-primary.scss | 6 +++++- src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss index 4a4c2293d..14bce384c 100644 --- a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss +++ b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss @@ -216,7 +216,6 @@ nav.bd-links { // Toctree captions p.caption { - font-size: var(--pst-sidebar-font-size); font-weight: var(--pst-sidebar-header-font-weight); position: relative; margin-top: 1.25rem; @@ -225,5 +224,10 @@ nav.bd-links { &:first-child { margin-top: 0; } + + font-size: var(--pst-sidebar-font-size-mobile); + @include media-breakpoint-up($breakpoint-sidebar-primary) { + font-size: var(--pst-sidebar-font-size); + } } } diff --git a/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss b/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss index db792ce5b..334d7b871 100644 --- a/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss +++ b/src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss @@ -19,7 +19,7 @@ html { // Sidebar styles --pst-sidebar-font-size: 0.9rem; - --pst-sidebar-font-size-mobile: 1.2rem; + --pst-sidebar-font-size-mobile: 1.1rem; --pst-sidebar-header-font-size: 1.2rem; --pst-sidebar-header-font-weight: 600;