-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Switch documentation to pydata-sphinx-theme #8708
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d3b8bdd
try pydata-sphinx-theme with no other alterations
TomNicholas c9c8694
Update conf.py
dcherian 64a6197
Update conf.py
dcherian 0c254da
merge main
scottyhq 9d72f9e
merge main, update theme settings
scottyhq 9b968ce
remove custom styling for old theme
scottyhq 43442c8
cleanup, fix autodoc warnings for common docstrings
scottyhq dbc612a
remove comments from debugging
scottyhq 2bb6ca0
ensure matplotlib inline used in gallery notebooks
scottyhq bca8b5a
reorganize sections
scottyhq db24e34
try jupyter_sphinx in overview for html rprs
scottyhq 46c2195
promote release-notes to navbar, create seperate social media section
scottyhq ce7b38c
Merge branch 'main' into pydata-sphinx-theme
dcherian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,273 +1,46 @@ | ||
table.colwidths-given { | ||
table-layout: fixed; | ||
width: 100%; | ||
} | ||
table.docutils td { | ||
white-space: unset; | ||
word-wrap: break-word; | ||
} | ||
|
||
.bd-header-announcement { | ||
background-color: var(--pst-color-info-bg); | ||
} | ||
|
||
/* Reduce left and right margins */ | ||
/* Override some aspects of the pydata-sphinx-theme */ | ||
|
||
.container, | ||
.container-lg, | ||
.container-md, | ||
.container-sm, | ||
.container-xl { | ||
max-width: 1350px !important; | ||
} | ||
|
||
/* Copied from | ||
https://github.com/bokeh/bokeh/blob/branch-2.4/sphinx/source/bokeh/static/custom.css | ||
/* Xarray Branding Guide: | ||
Primary Color palette (Hex): #17afb4 #e28126 #59c7d6 #0e4666 #4a4a4a | ||
Secondary Color Palette (Hex): #f58154 #e7b72d #b3dfe5 #8e8d99 #767985 | ||
Primary Typeface: Acumin Variable Concept - Semicondensed Medium | ||
*/ | ||
|
||
:root { | ||
/* Logo image height + all the paddings/margins make the navbar height. */ | ||
--navbar-height: calc(30px + 0.3125rem * 2 + 0.5rem * 2); | ||
} | ||
|
||
.bd-search { | ||
position: relative; | ||
padding-bottom: 20px; | ||
} | ||
|
||
@media (min-width: 768px) { | ||
.search-front-page { | ||
width: 50%; | ||
} | ||
} | ||
|
||
/* minimal copy paste from bootstrap docs css to get sidebars working */ | ||
|
||
.bd-toc { | ||
-ms-flex-order: 2; | ||
order: 2; | ||
padding-top: 1.5rem; | ||
padding-bottom: 1.5rem; | ||
/* font-size: 0.875rem; */ | ||
/* add scrolling sidebar */ | ||
height: calc(100vh - 2rem); | ||
overflow-y: auto; | ||
} | ||
|
||
@supports ((position: -webkit-sticky) or (position: sticky)) { | ||
.bd-toc { | ||
position: -webkit-sticky; | ||
position: sticky; | ||
top: 4rem; | ||
height: calc(100vh - 4rem); | ||
overflow-y: auto; | ||
} | ||
} | ||
|
||
.section-nav { | ||
padding-left: 0; | ||
border-left: 1px solid #eee; | ||
border-bottom: none; | ||
} | ||
|
||
.section-nav ul { | ||
padding-left: 1rem; | ||
} | ||
|
||
.toc-entry { | ||
display: block; | ||
} | ||
|
||
.toc-entry a { | ||
display: block; | ||
padding: 0.125rem 1.5rem; | ||
color: #77757a; | ||
} | ||
|
||
.toc-entry a:hover { | ||
color: rgba(0, 0, 0, 0.85); | ||
text-decoration: none; | ||
} | ||
|
||
.bd-sidebar { | ||
-ms-flex-order: 0; | ||
order: 0; | ||
border-bottom: 1px solid rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
@media (min-width: 768px) { | ||
.bd-sidebar { | ||
border-right: 1px solid rgba(0, 0, 0, 0.1); | ||
} | ||
@supports ((position: -webkit-sticky) or (position: sticky)) { | ||
.bd-sidebar { | ||
position: -webkit-sticky; | ||
position: sticky; | ||
top: var(--navbar-height); | ||
z-index: 1000; | ||
height: calc(100vh - var(--navbar-height)); | ||
} | ||
} | ||
} | ||
|
||
@media (min-width: 1200px) { | ||
.bd-sidebar { | ||
-ms-flex: 0 1 320px; | ||
flex: 0 1 320px; | ||
} | ||
} | ||
|
||
.bd-links { | ||
padding-top: 1rem; | ||
padding-bottom: 1rem; | ||
margin-right: -15px; | ||
margin-left: -15px; | ||
} | ||
|
||
@media (min-width: 768px) { | ||
@supports ((position: -webkit-sticky) or (position: sticky)) { | ||
.bd-links { | ||
max-height: calc(100vh - 9rem); | ||
overflow-y: auto; | ||
} | ||
} | ||
} | ||
|
||
@media (min-width: 768px) { | ||
.bd-links { | ||
display: block !important; | ||
} | ||
} | ||
|
||
.bd-sidenav { | ||
display: none; | ||
} | ||
|
||
.bd-toc-link { | ||
display: block; | ||
padding: 0.25rem 1.5rem; | ||
font-weight: 400; | ||
color: rgba(0, 0, 0, 0.65); | ||
/* Increase Xarray logo size in upper left corner */ | ||
.navbar-brand img { | ||
height: 75px; | ||
} | ||
|
||
.bd-toc-link:hover { | ||
color: rgba(0, 0, 0, 0.85); | ||
text-decoration: none; | ||
.navbar-brand { | ||
height: 75px; | ||
} | ||
|
||
.bd-toc-item.active { | ||
margin-bottom: 1rem; | ||
/* Adjust index page overview cards, borrowed from Pandas & Numpy */ | ||
/* Override SVG icon color */ | ||
html[data-theme="dark"] .sd-card img[src*=".svg"] { | ||
filter: invert(0.82) brightness(0.8) contrast(1.2); | ||
} | ||
|
||
.bd-toc-item.active:not(:first-child) { | ||
margin-top: 1rem; | ||
/* https://github.com/executablebooks/sphinx-design/blob/main/style/_cards.scss */ | ||
/* More space around image */ | ||
.intro-card { | ||
padding: 30px 1px 1px 1px; | ||
} | ||
|
||
.bd-toc-item.active > .bd-toc-link { | ||
color: rgba(0, 0, 0, 0.85); | ||
/* More prominent card borders */ | ||
.intro-card .sd-card { | ||
border: 2px solid var(--pst-color-border); | ||
overflow: hidden; | ||
} | ||
|
||
.bd-toc-item.active > .bd-toc-link:hover { | ||
background-color: transparent; | ||
/* Shrink SVG icons */ | ||
.intro-card .sd-card-img-top { | ||
margin: 1px; | ||
height: 100px; | ||
background-color: transparent !important; | ||
} | ||
|
||
.bd-toc-item.active > .bd-sidenav { | ||
display: block; | ||
/* Color titles like links */ | ||
.intro-card .sd-card-title { | ||
color: var(--pst-color-primary); | ||
font-size: var(--pst-font-size-h5); | ||
} | ||
|
||
.bd-sidebar .nav > li > a { | ||
display: block; | ||
padding: 0.25rem 1.5rem; | ||
font-size: 90%; | ||
} | ||
|
||
.bd-sidebar .nav > li > a:hover { | ||
text-decoration: none; | ||
background-color: transparent; | ||
} | ||
|
||
.bd-sidebar .nav > .active > a, | ||
.bd-sidebar .nav > .active:hover > a { | ||
font-weight: 400; | ||
/* adjusted from original | ||
color: rgba(0, 0, 0, 0.85); | ||
background-color: transparent; */ | ||
} | ||
|
||
.bd-sidebar .nav > li > ul { | ||
list-style: none; | ||
padding: 0.25rem 1.5rem; | ||
} | ||
|
||
.bd-sidebar .nav > li > ul > li > a { | ||
display: block; | ||
padding: 0.25rem 1.5rem; | ||
font-size: 90%; | ||
} | ||
|
||
.bd-sidebar .nav > li > ul > .active > a, | ||
.bd-sidebar .nav > li > ul > .active:hover > a { | ||
font-weight: 400; | ||
} | ||
|
||
dt:target { | ||
background-color: initial; | ||
} | ||
|
||
/* Offsetting anchored elements within the main content to adjust for fixed header | ||
https://github.com/pandas-dev/pandas-sphinx-theme/issues/6 */ | ||
main *:target::before { | ||
display: block; | ||
content: ""; | ||
height: var(--navbar-height); | ||
margin-top: calc(-1 * var(--navbar-height)); | ||
} | ||
|
||
body { | ||
width: 100%; | ||
} | ||
|
||
/* adjust toc font sizes to improve overview */ | ||
.toc-h2 { | ||
font-size: 0.85rem; | ||
} | ||
|
||
.toc-h3 { | ||
font-size: 0.75rem; | ||
} | ||
|
||
.toc-h4 { | ||
font-size: 0.65rem; | ||
} | ||
|
||
.toc-entry > .nav-link.active { | ||
font-weight: 400; | ||
color: #542437; | ||
background-color: transparent; | ||
border-left: 2px solid #563d7c; | ||
} | ||
|
||
.nav-link:hover { | ||
border-style: none; | ||
} | ||
|
||
/* Collapsing of the TOC sidebar while scrolling */ | ||
|
||
/* Nav: hide second level (shown on .active) */ | ||
.bd-toc .nav .nav { | ||
display: none; | ||
} | ||
|
||
.bd-toc .nav > .active > ul { | ||
display: block; | ||
} | ||
|
||
/* Main index page overview cards */ | ||
|
||
.sd-card-img-top { | ||
width: 33% !important; | ||
display: block; | ||
margin-left: auto; | ||
margin-right: auto; | ||
margin-top: 10px; | ||
/* Don't have 'raised' color background for card interiors in dark mode */ | ||
.bd-content .sd-card .sd-card-body { | ||
background-color: unset !important; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe most of this is making adjustments to the previous theme, and I found that simply removing most of it does fix #10223 (the issue of strange sidebar behavior with varying theme size). You can see that is remedied by making this browser window narrower https://xray--8708.org.readthedocs.build/en/8708/getting-started-guide/quick-overview.html