Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update the styles with pydata-sphinx-theme update #300

Merged
merged 12 commits into from
Sep 21, 2023
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
]
dependencies = [
"Sphinx>=4.2.0",
"pydata-sphinx-theme==0.14.1",
"pydata-sphinx-theme>=0.14.0",
"Jinja2>=3.1.2",
"importlib-metadata>=4.0",
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
<div class="container-xl">
<div class="row">
<div class="col-12 col-md-3" id="breadcrumbs-spacer"></div>
<div class="col-12 col-md-11 col-xl-9" id="breadcrumbs">{{ relbar() }}</div>
</div>
</div>
{% block breadcrumbs %}
<nav aria-label="{{ _('Breadcrumb') }}">
<ul class="bd-breadcrumbs">
{# Additional breadcrumbs before "Home" #} {% block rootrellink %} {% for
(name, href) in theme_additional_breadcrumbs %}
<li class="breadcrumb-item breadcrumb-home">
<a href="{{ href }}" class="nav-link">{{ name }}</a>
</li>
{% endfor %} {% endblock %} {# Home icon #}
<li class="breadcrumb-item">
<a
href="{{ pathto(root_doc) }}"
class="nav-link"
aria-label="{{ _('Home') }}"
>
<i class="fa-solid fa-home"></i
></a>
</li>

{%- for doc in parents %} {% if doc.link %}
<li class="breadcrumb-item">
<a href="{{ doc.link|e }}" class="nav-link">{{ doc.title }}</a>
</li>
{% else %}
<li class="breadcrumb-item">{{ doc.title }}</li>
{% endif %} {%- endfor %} {% if title and pagename != root_doc %} {# Current
page title #}
<li class="breadcrumb-item active" aria-current="page">{{ title }}</li>
{% endif %}
</ul>
</nav>
{% endblock %}
18 changes: 2 additions & 16 deletions src/ansys_sphinx_theme/theme/ansys_sphinx_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
the bootstrap stylesheet so we can override where necessary #} {%- block css %}
{{ super() }} {% if theme_show_breadcrumbs %}
<link href="{{ pathto('_static/css/breadcrumbs.css', 1) }}" rel="stylesheet" />
{% endif %} {%- endblock %} {% if not theme_show_prev_next %} {% set rellinks =
[] %} {% endif %} {% set reldelim1 = ' » ' %} {# The list of breadcrumbs is
defined as a
<ul />
, below we add additional root items #} {% block rootrellink %} {% for (name,
href) in theme_additional_breadcrumbs %}
<li class="nav-item nav-item-additional-breadcrumb">
<a href="{{ href }}">{{ name }}</a>{{ reldelim1 }}
</li>
{% endfor %} {% if pagename != 'index' %}
<li class="nav-item nav-item-0">
<a href="{{ pathto(root_doc) }}">{{ shorttitle }}</a>{{ reldelim1 }}
</li>
{% endif %} {% endblock %} {% block docs_navbar %} {{ super() }} {% if
{% endif %} {%- endblock %}{% block docs_navbar %} {{ super() }} {% if
theme_switcher %} {% include 'components/announcement_version.html' %} {% endif
%} {% if theme_show_breadcrumbs %} {% include 'components/breadcrumbs.html' %}
{% endif %} {% endblock %}
%} {% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ html[data-theme="light"] {
--pst-color-success: rgb(40, 167, 69);
--pst-color-text-base: rgb(0, 0, 0);
--pst-color-text-muted: rgb(26, 24, 24);
--pst-color-border: #c9c9c9;
--pst-color-border: #a19d9d;
--pst-color-shadow: rgb(216, 216, 216);
--pst-color-info: var(--pst-color-link);

Expand Down Expand Up @@ -616,8 +616,6 @@ Navigation column (according to side column)
############################################
*/
.col-lg-9 {
flex: 0 0 80%;
max-width: 80%;
padding-right: 5px;
padding-left: 20px;
}
Expand Down Expand Up @@ -661,8 +659,9 @@ strong {
font-weight: 900;
}

.bd-header .navbar-nav > .active > .nav-link {
border-bottom: 2px solid #fff;
.bd-header .navbar-header-items__start {
width: fit-content;
padding-right: 3rem;
}

.navbar-nav li a:focus,
Expand Down Expand Up @@ -700,6 +699,15 @@ nav.bd-links li > a:hover {
color: var(--pst-color-link) !important;
}

.bd-header .navbar-nav .dropdown button:hover {
color: white;
}

.dropdown-item:hover {
font-weight: bold;
background-color: transparent;
}

/*
##################
icon, button, logo
Expand Down Expand Up @@ -744,16 +752,26 @@ kbd {
color: #f8f9fa;
}

html[data-theme="light"] .theme-switch-button span:hover {
color: #0d0d0d;
.theme-switch-button span:hover {
color: var(--ansysGold);
border-color: white;
}

.search-button-field {
color: white;
background-color: transparent;
}

.search-button-field:hover {
color: var(--pst-color-border);
}

/* make the github logo white */

i.fa-github-square:before,
i.fa-square-github:before {
color: white;
font-size: 2rem;
font-size: 1rem;
}

.version-switcher__menu a.list-group-item:hover {
Expand All @@ -778,6 +796,9 @@ i.fa-square-github:before {
color: white;
}

html[data-theme="light"] #pst-back-to-top {
background-color: var(--pst-color-link);
}
/*
##############################
image padding before and after
Expand Down Expand Up @@ -1047,3 +1068,7 @@ search hide match
div#searchbox p.highlight-link a {
background-color: var(--pst-color-search-match);
}

.header-article__inner {
padding: 0 1rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ additional_breadcrumbs =
use_edit_page_button = True
switcher =
use_meilisearch =
article_header_start =
article_header_start = breadcrumbs.html
footer_end = theme-version.html
Loading