Skip to content

Commit cf0824a

Browse files
Carreautrallard
andauthored
MAINT: various fixes to print CSS. (#1770)
Co-authored-by: Tania Allard <[email protected]>
1 parent 4fd33b2 commit cf0824a

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss

+2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ div.deprecated {
55
margin: 1.5625em auto;
66
padding: 0 0.6rem 0 0.6rem;
77
overflow: hidden;
8+
/* break-inside has replaced page-break-inside and is widely usable since 2019 */
89
page-break-inside: avoid;
10+
break-inside: avoid;
911
border-left: 0.2rem solid;
1012
border-color: var(--pst-color-info);
1113
border-radius: $admonition-border-radius;

src/pydata_sphinx_theme/assets/styles/content/_admonitions.scss

+2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ div.admonition,
99
margin: 1.5625em auto;
1010
padding: 0 0.6rem 0.8rem 0.6rem;
1111
overflow: hidden;
12+
/* break-inside has replaced page-break-inside and is widely usable since 2019 */
1213
page-break-inside: avoid;
14+
break-inside: avoid;
1315
border-left: $admonition-left-border-width solid;
1416
border-color: var(--pst-color-info);
1517
border-radius: $admonition-border-radius;

src/pydata_sphinx_theme/assets/styles/content/_code.scss

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ div.literal-block-wrapper {
1212
flex-direction: column;
1313
width: unset;
1414
border-radius: $admonition-border-radius;
15+
break-inside: avoid;
1516
}
1617

1718
// Code blocks with captions

src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/breadcrumbs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
{#- Hide breadcrumbs on the home page #}
1212
{% if title and pagename != root_doc %}
13-
<nav aria-label="{{ _('Breadcrumb') }}">
13+
<nav aria-label="{{ _('Breadcrumb') }}" class="d-print-none">
1414
<ul class="bd-breadcrumbs">
1515
{# Home icon #}
1616
<li class="breadcrumb-item breadcrumb-home">

src/pydata_sphinx_theme/theme/pydata_sphinx_theme/layout.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
{# A button hidden by default to help assistive devices quickly jump to main content #}
3838
{# ref: https://www.youtube.com/watch?v=VUR0I5mqq7I #}
39-
<div id="pst-skip-link" class="skip-link"><a href="#main-content">{{ _("Skip to main content") }}</a></div>
39+
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">{{ _("Skip to main content") }}</a></div>
4040

4141
{%- endblock %}
4242

@@ -72,7 +72,7 @@
7272
{% include "sections/announcement.html" %}
7373
{%- endif %}
7474
{% block docs_navbar %}
75-
<header class="bd-header navbar navbar-expand-lg bd-navbar">
75+
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
7676
{%- include "sections/header.html" %}
7777
</header>
7878
{% endblock docs_navbar %}
@@ -94,7 +94,7 @@
9494
<div class="bd-content">
9595
<div class="bd-article-container">
9696
{# Article header #}
97-
<div class="bd-header-article">{% include "sections/header-article.html" %}</div>
97+
<div class="bd-header-article d-print-none">{% include "sections/header-article.html" %}</div>
9898
{# Article content #}
9999
{% block docs_body %}
100100
{# This is empty and only shows up if text has been highlighted by the URL #}
@@ -111,7 +111,7 @@
111111
{% endif %}
112112
{# prev-next buttons #}
113113
{% if theme_show_prev_next %}
114-
<footer class="prev-next-footer">
114+
<footer class="prev-next-footer d-print-none">
115115
{% include "components/prev-next.html" %}
116116
</footer>
117117
{% endif %}

src/pydata_sphinx_theme/theme/pydata_sphinx_theme/sections/announcement.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{# If we are remote, add a script to make an HTTP request for the value on page load #}
55
{%- if is_remote %}
66
<script>
7-
document.write(`<aside class="bd-header-announcement" aria-label="{{ banner_label }}"></aside>`);
7+
document.write(`<aside class="bd-header-announcement d-print-none" aria-label="{{ banner_label }}"></aside>`);
88
fetch("{{ theme_announcement }}")
99
.then(res => {return res.text();})
1010
.then(data => {

0 commit comments

Comments
 (0)