From b961fc60e4ee3d2fcf1876acee000069518255d6 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Fri, 9 May 2025 13:26:57 +0200 Subject: [PATCH 1/5] style: add navbar styles for center alignment --- .../assets/styles/ansys-sphinx-theme.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme.scss b/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme.scss index 812080d47..c2d60faae 100644 --- a/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme.scss +++ b/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme.scss @@ -42,3 +42,11 @@ p.rubric { .autosummary tr:nth-child(even) { background-color: var(--pst-color-background); } + +/* +* Navbar styles +*/ + +.bd-navbar-elements { + text-align: center; +} \ No newline at end of file From affe6fb17090e8919119e618216f25f9eb2a4e1d Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 12 May 2025 11:05:38 +0200 Subject: [PATCH 2/5] feat: centering content container --- .../assets/styles/ansys-sphinx-theme.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme.scss b/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme.scss index c2d60faae..1e009ff28 100644 --- a/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme.scss +++ b/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme.scss @@ -49,4 +49,8 @@ p.rubric { .bd-navbar-elements { text-align: center; -} \ No newline at end of file +} + +.bd-main .bd-content { + justify-content: center; +} From 7dbe82af71eb841a776d929d4ad0890b64ba3d45 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 12 May 2025 11:06:35 +0200 Subject: [PATCH 3/5] feat: moving search bar to the `navbar_end` so it hides when there is no space. --- src/ansys_sphinx_theme/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ansys_sphinx_theme/__init__.py b/src/ansys_sphinx_theme/__init__.py index 2fb54fa5e..c47b128a4 100644 --- a/src/ansys_sphinx_theme/__init__.py +++ b/src/ansys_sphinx_theme/__init__.py @@ -156,8 +156,11 @@ def setup_default_html_theme_options(app): # Place all switchers and icons at the end of the navigation bar if theme_options.get("switcher"): theme_options.setdefault( - "navbar_end", ["version-switcher", "theme-switcher", "navbar-icon-links"] + "navbar_end", + ["search-field", "version-switcher", "theme-switcher", "navbar-icon-links"], ) + + theme_options.setdefault("navbar_persistent", []) theme_options.setdefault("collapse_navigation", True) theme_options.setdefault("navigation_with_keys", True) From ca60b135ef165289874da5da489ac1cfb086eede Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 12 May 2025 09:11:14 +0000 Subject: [PATCH 4/5] chore: adding changelog file 691.added.md [dependabot-skip] --- doc/changelog.d/691.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/691.added.md diff --git a/doc/changelog.d/691.added.md b/doc/changelog.d/691.added.md new file mode 100644 index 000000000..879a092b7 --- /dev/null +++ b/doc/changelog.d/691.added.md @@ -0,0 +1 @@ +small layout adjustments \ No newline at end of file From 68f708bd6de85dc942c316f9f8ae3b71bc6a514e Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 12 May 2025 11:46:35 +0200 Subject: [PATCH 5/5] feat: using our own search bar mechanism Co-authored-by: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> --- src/ansys_sphinx_theme/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys_sphinx_theme/__init__.py b/src/ansys_sphinx_theme/__init__.py index c47b128a4..85b017903 100644 --- a/src/ansys_sphinx_theme/__init__.py +++ b/src/ansys_sphinx_theme/__init__.py @@ -157,7 +157,7 @@ def setup_default_html_theme_options(app): if theme_options.get("switcher"): theme_options.setdefault( "navbar_end", - ["search-field", "version-switcher", "theme-switcher", "navbar-icon-links"], + ["search-button-field", "version-switcher", "theme-switcher", "navbar-icon-links"], ) theme_options.setdefault("navbar_persistent", [])