diff --git a/docs/conf.py b/docs/conf.py index 8f4561d96..582d51e14 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -116,7 +116,7 @@ { "name": "PyPI", "url": "https://pypi.org/project/pydata-sphinx-theme", - "icon": "fas fa-box", + "icon": "fa-solid fa-box", }, { "name": "PyData", diff --git a/docs/user_guide/fonts.rst b/docs/user_guide/fonts.rst index 5e2bb47ad..1b5e35e87 100644 --- a/docs/user_guide/fonts.rst +++ b/docs/user_guide/fonts.rst @@ -2,7 +2,7 @@ Fonts and FontAwesome ===================== The theme includes the `FontAwesome 6 Free `__ -icon font (the ``.fa, .far, .fas`` styles, which are used for +icon font (the ``.fa-solid, .fa-regular, .fa-brands`` styles, which are used for :ref:`icon links ` and admonitions). This is the only *vendored* font, and otherwise the theme by default relies on available system fonts for normal body text and headers. diff --git a/docs/user_guide/header-links.rst b/docs/user_guide/header-links.rst index 0c46ef22b..95f302c07 100644 --- a/docs/user_guide/header-links.rst +++ b/docs/user_guide/header-links.rst @@ -59,7 +59,7 @@ These links take the following form: # URL where the link will redirect "url": "https://github.com//", # required # Icon class (if "type": "fontawesome"), or path to local image (if "type": "local") - "icon": "fab fa-github-square", + "icon": "fa-brands fa-square-github", # The type of image to be used (see below for details) "type": "fontawesome", } @@ -91,7 +91,7 @@ specifying a FontAwesome class in the ``icon`` value. The value of ``icon`` can be any full `FontAwesome 6 Free `__ icon. In addition to the main icon class, e.g. ``fa-cat``, the "style" class must -also be provided e.g. `fab` for *branding*, or `fas` for *solid*. +also be provided e.g. `fa-brands` for *branding*, or `fa-solid` for *solid*. Here are several examples: @@ -103,25 +103,25 @@ Here are several examples: { "name": "GitHub", "url": "https://github.com//", - "icon": "fab fa-github-square", + "icon": "fa-brands fa-square-github", "type": "fontawesome", }, { "name": "GitLab", "url": "https://gitlab.com//", - "icon": "fab fa-gitlab", + "icon": "fa-brands fa-square-gitlab", "type": "fontawesome", }, { "name": "Twitter", "url": "https://twitter.com/", - "icon": "fab fa-twitter-square", + "icon": "fa-brands fa-square-twitter", # The default for `type` is `fontawesome` so it is not actually required in any of the above examples as it is shown here }, { "name": "Mastodon", "url": "https://@", - "icon": "fab fa-mastodon", + "icon": "fa-brands fa-mastodon", }, ], ... diff --git a/src/pydata_sphinx_theme/__init__.py b/src/pydata_sphinx_theme/__init__.py index 48220d231..724d70c32 100644 --- a/src/pydata_sphinx_theme/__init__.py +++ b/src/pydata_sphinx_theme/__init__.py @@ -270,7 +270,7 @@ def generate_header_nav_html(n_links_before_dropdown=5): links_html.append( f""" """ # noqa ) @@ -510,7 +510,7 @@ def _add_collapse_checkboxes(soup): label = soup.new_tag( "label", attrs={"for": checkbox_name, "class": "toctree-toggle"} ) - label.append(soup.new_tag("i", attrs={"class": "fas fa-chevron-down"})) + label.append(soup.new_tag("i", attrs={"class": "fa-solid fa-chevron-down"})) if "toctree-l0" in classes: # making label cover the whole caption text with css label["class"] = "label-parts" diff --git a/src/pydata_sphinx_theme/assets/styles/components/_icon-links.scss b/src/pydata_sphinx_theme/assets/styles/components/_icon-links.scss index 19161bf4c..16a102f9c 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_icon-links.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_icon-links.scss @@ -4,21 +4,20 @@ #navbar-icon-links { i { - &.fa, - &.fab, - &.far, - &.fas { + &.fa-brands, + &.fa-regular, + &.fa-solid { vertical-align: middle; font-style: normal; font-size: var(--pst-font-size-icon); } /* Social media buttons */ - &.fa-twitter-square:before { + &.fa-square-twitter:before { color: #55acee; } - &.fa-gitlab:before { + &.fa-square-gitlab:before { color: #548; } diff --git a/src/pydata_sphinx_theme/assets/styles/components/_search.scss b/src/pydata_sphinx_theme/assets/styles/components/_search.scss index bff43e350..04e62cf59 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_search.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_search.scss @@ -13,6 +13,10 @@ left: 25px; } + i.fa-solid.fa-magnifying-glass { + padding-right: 0.5rem; + } + input { background-color: var(--pst-color-background); border-radius: $admonition-border-radius; @@ -86,6 +90,10 @@ margin-top: 0.5rem; width: 90%; max-width: 800px; + + i.fa-solid.fa-magnifying-glass { + padding-right: 0.5rem; + } } .search-button__overlay { diff --git a/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss b/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss index 40d160783..e99b0cf06 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss @@ -53,7 +53,7 @@ span.versionmodified { font-style: normal; margin-right: 0.6rem; color: var(--pst-color-info); - font-family: "Font Awesome 5 Free"; + font-family: "Font Awesome 6 Free"; font-weight: 900; content: var(--pst-icon-versionmodified-default); } diff --git a/src/pydata_sphinx_theme/assets/styles/content/_admonitions.scss b/src/pydata_sphinx_theme/assets/styles/content/_admonitions.scss index 3e736b671..ed965cd8c 100644 --- a/src/pydata_sphinx_theme/assets/styles/content/_admonitions.scss +++ b/src/pydata_sphinx_theme/assets/styles/content/_admonitions.scss @@ -45,7 +45,7 @@ div.admonition, width: 1rem; height: 1rem; color: var(--pst-color-info); - font-family: "Font Awesome 5 Free"; + font-family: "Font Awesome 6 Free"; font-weight: 900; content: var(--pst-icon-admonition-default); opacity: 1; diff --git a/src/pydata_sphinx_theme/assets/styles/content/_spans.scss b/src/pydata_sphinx_theme/assets/styles/content/_spans.scss index 139a7226e..9c9a39e1c 100644 --- a/src/pydata_sphinx_theme/assets/styles/content/_spans.scss +++ b/src/pydata_sphinx_theme/assets/styles/content/_spans.scss @@ -16,8 +16,8 @@ span.guilabel { } a.reference.download:before { - content: "\f019"; - font-family: "Font Awesome 5 Free"; + content: var(--pst-icon-download); + font-family: "Font Awesome 6 Free"; font-size: 0.8em; font-weight: 600; padding: 0 0.25em; diff --git a/src/pydata_sphinx_theme/assets/styles/extensions/_ablog.scss b/src/pydata_sphinx_theme/assets/styles/extensions/_ablog.scss index afd0d1175..4ab514249 100644 --- a/src/pydata_sphinx_theme/assets/styles/extensions/_ablog.scss +++ b/src/pydata_sphinx_theme/assets/styles/extensions/_ablog.scss @@ -31,14 +31,14 @@ article.bd-article > section + div.section { font-size: 1.2em; span:first-child:before { - content: "\f104"; - font-family: "Font Awesome 5 Free"; + content: var(--pst-icon-angle-left); + font-family: "Font Awesome 6 Free"; font-weight: 800; } span:last-child:after { - content: "\f105"; - font-family: "Font Awesome 5 Free"; + content: var(--pst-icon-angle-right); + font-family: "Font Awesome 6 Free"; font-weight: 800; } } 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 6ce31e20f..39d54ff5f 100644 --- a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss +++ b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-primary.scss @@ -185,9 +185,9 @@ nav.bd-links { &.reference.external { &:after { - font-family: "Font Awesome 5 Free"; + font-family: "Font Awesome 6 Free"; font-weight: 900; - content: "\f35d"; + content: var(--pst-icon-external-link); font-size: 0.75em; margin-left: 0.3em; } 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 71be83436..34b65e30c 100644 --- a/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-secondary.scss +++ b/src/pydata_sphinx_theme/assets/styles/sections/_sidebar-secondary.scss @@ -64,8 +64,8 @@ div#searchbox { // match padding to .toc-item > i above // f010 is magnifying glass minus &:before { - content: "\f010"; - font-family: FontAwesome; + content: var(--pst-icon-search-minus); + font-family: "Font Awesome 6 Free"; padding-right: 0.5rem; } } diff --git a/src/pydata_sphinx_theme/assets/styles/variables/_icons.scss b/src/pydata_sphinx_theme/assets/styles/variables/_icons.scss index 4b3046c9b..3cbbb22c4 100644 --- a/src/pydata_sphinx_theme/assets/styles/variables/_icons.scss +++ b/src/pydata_sphinx_theme/assets/styles/variables/_icons.scss @@ -7,10 +7,15 @@ --pst-font-size-icon: 1.5rem; // Font Awesome default icons - --pst-icon-check-circle: "\f058"; // fas fa-check-circle - --pst-icon-info-circle: "\f05a"; // fas fa-info-circle - --pst-icon-exclamation-triangle: "\f071"; // fas fa-exclamation-triangle - --pst-icon-exclamation-circle: "\f06a"; // fas fa-exclamation-circle - --pst-icon-times-circle: "\f057"; // fas fa-times-circle - --pst-icon-lightbulb: "\f0eb"; // fas fa-lightbulb + --pst-icon-check-circle: "\f058"; // fa-solid fa-circle-check + --pst-icon-info-circle: "\f05a"; // fa-solid fa-circle-info + --pst-icon-exclamation-triangle: "\f071"; // fa-solid fa-triangle-exclamation + --pst-icon-exclamation-circle: "\f06a"; // fa-solid fa-circle-exclamation + --pst-icon-times-circle: "\f057"; // fa-solid fa-circle-xmark + --pst-icon-lightbulb: "\f0eb"; // fa-solid fa-lightbulb + --pst-icon-download: "\f019"; // fa-solid fa-download + --pst-icon-angle-left: "\f104"; // fa-solid fa-angle-left + --pst-icon-angle-right: "\f105"; // fa-solid fa-angle-right + --pst-icon-external-link: "\f35d"; // fa-solid fa-up-right-from-square + --pst-icon-search-minus: "\f010"; // fa-solid fa-magnifying-glass-minus } diff --git a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/edit-this-page.html b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/edit-this-page.html index 186a7ff61..947d64200 100644 --- a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/edit-this-page.html +++ b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/edit-this-page.html @@ -2,7 +2,7 @@ {% set src = sourcename.split('.') %} {% endif %} diff --git a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/footer-article/prev-next.html b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/footer-article/prev-next.html index 8ffdfba8b..19247575a 100644 --- a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/footer-article/prev-next.html +++ b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/footer-article/prev-next.html @@ -2,7 +2,7 @@ diff --git a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/icon-links.html b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/icon-links.html index 144071137..98ecbc08f 100644 --- a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/icon-links.html +++ b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/icon-links.html @@ -28,10 +28,10 @@