pydata / pydata-sphinx-theme

A clean, three-column Sphinx theme with Bootstrap for the PyData community
https://pydata-sphinx-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
561 stars 304 forks source link

text lines at the bottom are covered by 'skip to main content' while print a page #1745

Closed berlin2123 closed 2 months ago

berlin2123 commented 3 months ago

I first discovered this issue in sphinx-book-theme: https://github.com/executablebooks/sphinx-book-theme/issues/828

The same issue in pydata-sphinx-theme, while print a page by Ctrl + P. lines at the bottom may be covered by 'skip to main content' in some pages of print.

You can see the screenshot in https://github.com/executablebooks/sphinx-book-theme/issues/828 or https://github.com/executablebooks/jupyter-book/issues/2045

berlin2123 commented 3 months ago

Temporary solution: Add the following into custem.css, see how to add.
It seems disabled the skip-link.

/* fix: ship to main content while print webpage */
.skip-link {
    position: absolute;
}
drammock commented 3 months ago

based on a quick search, seems like adding CSS rules under @media print (and ideally isolating them in in a dedicated stylesheet) is the recommended approach: