diff --git a/doc/changelog.d/401.added.md b/doc/changelog.d/401.added.md new file mode 100644 index 00000000..702774c1 --- /dev/null +++ b/doc/changelog.d/401.added.md @@ -0,0 +1 @@ +fix: update the github icon \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c48fec67..263e786d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi" [project] # Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections name = "ansys-sphinx-theme" -version = "0.16.5" +version = "0.16.6" description = "A theme devised by ANSYS, Inc. for Sphinx documentation." readme = "README.rst" requires-python = ">=3.9,<4" diff --git a/src/ansys_sphinx_theme/__init__.py b/src/ansys_sphinx_theme/__init__.py index dfacaf4f..dc0051ae 100644 --- a/src/ansys_sphinx_theme/__init__.py +++ b/src/ansys_sphinx_theme/__init__.py @@ -167,12 +167,25 @@ def setup_default_html_theme_options(app): """ # Place all switchers and icons at the end of the navigation bar - if app.config.html_theme_options.get("switcher"): - app.config.html_theme_options.setdefault( + theme_options = app.config.html_theme_options + # 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"] ) - app.config.html_theme_options.setdefault("collapse_navigation", True) - app.config.html_theme_options.setdefault("navigation_with_keys", True) + theme_options.setdefault("collapse_navigation", True) + theme_options.setdefault("navigation_with_keys", True) + + # Update the icon links. If not given, add a default GitHub icon. + if not theme_options.get("icon_links") and theme_options.get("github_url"): + theme_options["icon_links"] = [ + { + "name": "GitHub", + "url": theme_options["github_url"], + "icon": "fa-brands fa-github", + } + ] + theme_options["github_url"] = None def fix_edit_html_page_context( diff --git a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/css/ansys_sphinx_theme.css b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/css/ansys_sphinx_theme.css index cfc0c6e6..e0bc7823 100644 --- a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/css/ansys_sphinx_theme.css +++ b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/css/ansys_sphinx_theme.css @@ -600,6 +600,10 @@ Navigation column (according to side column) display: unset; } +.theme-switch-button span { + color: #fff; +} + /* ################################# Syntax highlighting in code block @@ -677,28 +681,11 @@ icon, button, logo ################## */ -button, -input, -optgroup, -select, -textarea, -button:hover { - color: #ddd; -} - -.theme-switch-button { - border-color: #f8f9fa; -} - button.btn.version-switcher__button { border-color: var(--pst-color-border); color: #ddd; } -button.version-switcher__button:hover { - color: #f8f8f2; -} - button.version-switcher__button { color: #f8f9fa; } @@ -748,15 +735,6 @@ icon, button, logo for small screen } } -.theme-switch-button span { - color: #f8f9fa; -} - -.theme-switch-button span:hover { - color: var(--ansysGold); - border-color: white; -} - .navbar-icon-links { column-gap: 0.2rem; } @@ -772,12 +750,6 @@ icon, button, logo for small screen /* make the github logo white */ -i.fa-github-square:before, -i.fa-square-github:before { - color: white; - font-size: 1rem; -} - .version-switcher__menu a.list-group-item:hover { background-color: #d09735 !important; border-color: var(--pst-color-text-base) !important; @@ -795,11 +767,6 @@ i.fa-square-github:before { color: white; } -.navbar-icon-links { - font-size: 1.5rem; - color: white; -} - html[data-theme="light"] #pst-back-to-top { background-color: var(--pst-color-link); }