From 8da2efb1d71ab2d384ddc90cf4fdebe5d18e91cd Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 7 Jun 2022 23:09:12 +0100 Subject: [PATCH 1/3] Rename CSS files to CSS template files --- sphinx/themes/nonav/static/{nonav.css => nonav.css_t} | 0 sphinx/themes/pyramid/static/{epub.css => epub.css_t} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename sphinx/themes/nonav/static/{nonav.css => nonav.css_t} (100%) rename sphinx/themes/pyramid/static/{epub.css => epub.css_t} (100%) diff --git a/sphinx/themes/nonav/static/nonav.css b/sphinx/themes/nonav/static/nonav.css_t similarity index 100% rename from sphinx/themes/nonav/static/nonav.css rename to sphinx/themes/nonav/static/nonav.css_t diff --git a/sphinx/themes/pyramid/static/epub.css b/sphinx/themes/pyramid/static/epub.css_t similarity index 100% rename from sphinx/themes/pyramid/static/epub.css rename to sphinx/themes/pyramid/static/epub.css_t From 5806f0af2788db40661d62e5e88c2c1560ae46b6 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 7 Jun 2022 23:10:15 +0100 Subject: [PATCH 2/3] Add `nav.contents` everywhere that `div.topic` is used --- doc/_themes/sphinx13/static/sphinx13.css | 1 + sphinx/themes/basic/static/basic.css_t | 12 ++++++++++++ sphinx/themes/bizstyle/static/bizstyle.css_t | 3 +++ sphinx/themes/classic/static/classic.css_t | 3 +++ sphinx/themes/epub/static/epub.css_t | 3 +++ sphinx/themes/nature/static/nature.css_t | 3 +++ sphinx/themes/nonav/static/nonav.css_t | 3 +++ sphinx/themes/pyramid/static/epub.css_t | 3 +++ sphinx/themes/pyramid/static/pyramid.css_t | 3 +++ sphinx/themes/sphinxdoc/static/sphinxdoc.css_t | 3 +++ sphinx/themes/traditional/static/traditional.css_t | 3 +++ 11 files changed, 40 insertions(+) diff --git a/doc/_themes/sphinx13/static/sphinx13.css b/doc/_themes/sphinx13/static/sphinx13.css index 789a5d4f312..5d64eda512a 100644 --- a/doc/_themes/sphinx13/static/sphinx13.css +++ b/doc/_themes/sphinx13/static/sphinx13.css @@ -372,6 +372,7 @@ div.quotebar { margin-left: 1em; } +nav.contents, div.topic, aside.topic { background-color: #f8f8f8; diff --git a/sphinx/themes/basic/static/basic.css_t b/sphinx/themes/basic/static/basic.css_t index 67bfec755ca..0a0447f0ff4 100644 --- a/sphinx/themes/basic/static/basic.css_t +++ b/sphinx/themes/basic/static/basic.css_t @@ -337,12 +337,18 @@ p.sidebar-title { font-weight: bold; } +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.admonition, div.topic, aside.topic, blockquote { clear: left; } /* -- topics ---------------------------------------------------------------- */ +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.topic, aside.topic { border: 1px solid #ccc; padding: 7px; @@ -381,6 +387,9 @@ div.body p.centered { div.sidebar > :last-child, aside.sidebar > :last-child, +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents > :last-child, +{% endif %} div.topic > :last-child, aside.topic > :last-child, div.admonition > :last-child { @@ -389,6 +398,9 @@ div.admonition > :last-child { div.sidebar::after, aside.sidebar::after, +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents::after, +{% endif %} div.topic::after, aside.topic::after, div.admonition::after, diff --git a/sphinx/themes/bizstyle/static/bizstyle.css_t b/sphinx/themes/bizstyle/static/bizstyle.css_t index b5c84e0bb59..47dcc7e4fb0 100644 --- a/sphinx/themes/bizstyle/static/bizstyle.css_t +++ b/sphinx/themes/bizstyle/static/bizstyle.css_t @@ -306,6 +306,9 @@ div.quotebar { border: 1px solid #ccc; } +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.topic, aside.topic { background-color: #f8f8f8; } diff --git a/sphinx/themes/classic/static/classic.css_t b/sphinx/themes/classic/static/classic.css_t index 58b55c8bf53..9107dc9344d 100644 --- a/sphinx/themes/classic/static/classic.css_t +++ b/sphinx/themes/classic/static/classic.css_t @@ -290,6 +290,9 @@ div.seealso { border: 1px solid #ff6; } +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.topic, aside.topic { background-color: #eee; } diff --git a/sphinx/themes/epub/static/epub.css_t b/sphinx/themes/epub/static/epub.css_t index bd64a1bc868..9cc47152bdc 100644 --- a/sphinx/themes/epub/static/epub.css_t +++ b/sphinx/themes/epub/static/epub.css_t @@ -245,6 +245,9 @@ p.sidebar-title { /* -- topics ---------------------------------------------------------------- */ +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.topic, aside.topic { border: 1px solid #ccc; padding: 7px 7px 0 7px; diff --git a/sphinx/themes/nature/static/nature.css_t b/sphinx/themes/nature/static/nature.css_t index f3c0d0224a6..c1a2cd6cb71 100644 --- a/sphinx/themes/nature/static/nature.css_t +++ b/sphinx/themes/nature/static/nature.css_t @@ -194,6 +194,9 @@ div.seealso { border: 1px solid #ff6; } +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.topic, aside.topic { background-color: #eee; } diff --git a/sphinx/themes/nonav/static/nonav.css_t b/sphinx/themes/nonav/static/nonav.css_t index 90c3300cf03..d62536ab230 100644 --- a/sphinx/themes/nonav/static/nonav.css_t +++ b/sphinx/themes/nonav/static/nonav.css_t @@ -234,6 +234,9 @@ p.sidebar-title { /* -- topics ---------------------------------------------------------------- */ +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.topic, aside.topic { border: 1px solid #ccc; padding: 7px 7px 0 7px; diff --git a/sphinx/themes/pyramid/static/epub.css_t b/sphinx/themes/pyramid/static/epub.css_t index 8606c8c8de0..7f59c670c84 100644 --- a/sphinx/themes/pyramid/static/epub.css_t +++ b/sphinx/themes/pyramid/static/epub.css_t @@ -254,6 +254,9 @@ div.seealso { border: 1px solid #ff6; } +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.topic, aside.topic { background-color: #eee; } diff --git a/sphinx/themes/pyramid/static/pyramid.css_t b/sphinx/themes/pyramid/static/pyramid.css_t index f093ba16493..bf18b8b156a 100644 --- a/sphinx/themes/pyramid/static/pyramid.css_t +++ b/sphinx/themes/pyramid/static/pyramid.css_t @@ -245,6 +245,9 @@ div.seealso { padding: 10px 20px 10px 60px; } +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.topic, aside.topic { background: #eeeeee; border: 2px solid #C6C9CB; diff --git a/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t b/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t index b6de4ae6f2e..f6a83840425 100644 --- a/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t +++ b/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t @@ -266,6 +266,9 @@ div.quotebar { border: 1px solid #ccc; } +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.topic, aside.topic { background-color: #f8f8f8; } diff --git a/sphinx/themes/traditional/static/traditional.css_t b/sphinx/themes/traditional/static/traditional.css_t index b5b05dc2186..5caf48ccf6c 100644 --- a/sphinx/themes/traditional/static/traditional.css_t +++ b/sphinx/themes/traditional/static/traditional.css_t @@ -506,6 +506,9 @@ p.rubric { /* "Topics" */ +{%- if docutils_version_info[:2] >= (0, 18) %} +nav.contents, +{% endif %} div.topic, aside.topic { background-color: #eee; border: 1px solid #ccc; From 27f05328d0369ad0db85c27935d52fdadf020f6b Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 7 Jun 2022 23:21:52 +0100 Subject: [PATCH 3/3] Move `aside.topic` into the conditional blocks --- sphinx/themes/basic/static/basic.css_t | 10 ++++++---- sphinx/themes/bizstyle/static/bizstyle.css_t | 3 ++- sphinx/themes/classic/static/classic.css_t | 3 ++- sphinx/themes/epub/static/epub.css_t | 3 ++- sphinx/themes/nature/static/nature.css_t | 3 ++- sphinx/themes/nonav/static/nonav.css_t | 3 ++- sphinx/themes/pyramid/static/epub.css_t | 3 ++- sphinx/themes/pyramid/static/pyramid.css_t | 3 ++- sphinx/themes/sphinxdoc/static/sphinxdoc.css_t | 3 ++- sphinx/themes/traditional/static/traditional.css_t | 3 ++- 10 files changed, 24 insertions(+), 13 deletions(-) diff --git a/sphinx/themes/basic/static/basic.css_t b/sphinx/themes/basic/static/basic.css_t index 0a0447f0ff4..d8f3fe74626 100644 --- a/sphinx/themes/basic/static/basic.css_t +++ b/sphinx/themes/basic/static/basic.css_t @@ -339,8 +339,9 @@ p.sidebar-title { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.admonition, div.topic, aside.topic, blockquote { +div.admonition, div.topic, blockquote { clear: left; } @@ -348,8 +349,9 @@ div.admonition, div.topic, aside.topic, blockquote { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.topic, aside.topic { +div.topic { border: 1px solid #ccc; padding: 7px; margin: 10px 0 10px 0; @@ -389,9 +391,9 @@ div.sidebar > :last-child, aside.sidebar > :last-child, {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents > :last-child, +aside.topic > :last-child, {% endif %} div.topic > :last-child, -aside.topic > :last-child, div.admonition > :last-child { margin-bottom: 0; } @@ -400,9 +402,9 @@ div.sidebar::after, aside.sidebar::after, {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents::after, +aside.topic::after, {% endif %} div.topic::after, -aside.topic::after, div.admonition::after, blockquote::after { display: block; diff --git a/sphinx/themes/bizstyle/static/bizstyle.css_t b/sphinx/themes/bizstyle/static/bizstyle.css_t index 47dcc7e4fb0..a524345f9a9 100644 --- a/sphinx/themes/bizstyle/static/bizstyle.css_t +++ b/sphinx/themes/bizstyle/static/bizstyle.css_t @@ -308,8 +308,9 @@ div.quotebar { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.topic, aside.topic { +div.topic { background-color: #f8f8f8; } diff --git a/sphinx/themes/classic/static/classic.css_t b/sphinx/themes/classic/static/classic.css_t index 9107dc9344d..789bec81128 100644 --- a/sphinx/themes/classic/static/classic.css_t +++ b/sphinx/themes/classic/static/classic.css_t @@ -292,8 +292,9 @@ div.seealso { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.topic, aside.topic { +div.topic { background-color: #eee; } diff --git a/sphinx/themes/epub/static/epub.css_t b/sphinx/themes/epub/static/epub.css_t index 9cc47152bdc..a30344431a0 100644 --- a/sphinx/themes/epub/static/epub.css_t +++ b/sphinx/themes/epub/static/epub.css_t @@ -247,8 +247,9 @@ p.sidebar-title { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.topic, aside.topic { +div.topic { border: 1px solid #ccc; padding: 7px 7px 0 7px; margin: 10px 0 10px 0; diff --git a/sphinx/themes/nature/static/nature.css_t b/sphinx/themes/nature/static/nature.css_t index c1a2cd6cb71..93f9a594483 100644 --- a/sphinx/themes/nature/static/nature.css_t +++ b/sphinx/themes/nature/static/nature.css_t @@ -196,8 +196,9 @@ div.seealso { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.topic, aside.topic { +div.topic { background-color: #eee; } diff --git a/sphinx/themes/nonav/static/nonav.css_t b/sphinx/themes/nonav/static/nonav.css_t index d62536ab230..933365e073c 100644 --- a/sphinx/themes/nonav/static/nonav.css_t +++ b/sphinx/themes/nonav/static/nonav.css_t @@ -236,8 +236,9 @@ p.sidebar-title { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.topic, aside.topic { +div.topic { border: 1px solid #ccc; padding: 7px 7px 0 7px; margin: 10px 0 10px 0; diff --git a/sphinx/themes/pyramid/static/epub.css_t b/sphinx/themes/pyramid/static/epub.css_t index 7f59c670c84..98741d0b8ab 100644 --- a/sphinx/themes/pyramid/static/epub.css_t +++ b/sphinx/themes/pyramid/static/epub.css_t @@ -256,8 +256,9 @@ div.seealso { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.topic, aside.topic { +div.topic { background-color: #eee; } diff --git a/sphinx/themes/pyramid/static/pyramid.css_t b/sphinx/themes/pyramid/static/pyramid.css_t index bf18b8b156a..0ced6b29f8e 100644 --- a/sphinx/themes/pyramid/static/pyramid.css_t +++ b/sphinx/themes/pyramid/static/pyramid.css_t @@ -247,8 +247,9 @@ div.seealso { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.topic, aside.topic { +div.topic { background: #eeeeee; border: 2px solid #C6C9CB; padding: 10px 20px; diff --git a/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t b/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t index f6a83840425..1817c48bcf5 100644 --- a/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t +++ b/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t @@ -268,8 +268,9 @@ div.quotebar { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.topic, aside.topic { +div.topic { background-color: #f8f8f8; } diff --git a/sphinx/themes/traditional/static/traditional.css_t b/sphinx/themes/traditional/static/traditional.css_t index 5caf48ccf6c..8a2f0712fbe 100644 --- a/sphinx/themes/traditional/static/traditional.css_t +++ b/sphinx/themes/traditional/static/traditional.css_t @@ -508,8 +508,9 @@ p.rubric { {%- if docutils_version_info[:2] >= (0, 18) %} nav.contents, +aside.topic, {% endif %} -div.topic, aside.topic { +div.topic { background-color: #eee; border: 1px solid #ccc; padding: 0 7px 0 7px;