-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix extra whitespace in sidebars (#1115)
* Fix extra whitespace in sidebars * Searchbox * Update src/pydata_sphinx_theme/__init__.py Co-authored-by: Daniel McCloy <dan@mccloy.info> * make test pass * Fix template filter to remove empty files * ABlog in template test * Move clear search button to primary sidebar * Move search clear button to top of article Co-authored-by: Daniel McCloy <dan@mccloy.info>
- Loading branch information
Showing
13 changed files
with
113 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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,24 +1,24 @@ | ||
- header: "@bollwyvl" | ||
image: https://avatars.githubusercontent.com/u/45380 | ||
link: https://github.com/bollwyvl | ||
website: https://github.com/bollwyvl | ||
- header: "@jarrodmillman" | ||
image: https://avatars.githubusercontent.com/u/123428 | ||
link: https://github.com/jarrodmillman | ||
website: https://github.com/jarrodmillman | ||
- header: "@hoetmaaiers" | ||
image: https://avatars.githubusercontent.com/u/468045 | ||
link: https://github.com/hoetmaaiers | ||
website: https://github.com/hoetmaaiers | ||
- header: "@jorisvandenbossche" | ||
image: https://avatars.githubusercontent.com/u/1020496 | ||
link: https://github.com/jorisvandenbossche | ||
website: https://github.com/jorisvandenbossche | ||
- header: "@damianavila" | ||
image: https://avatars.githubusercontent.com/u/1640669 | ||
link: https://github.com/damianavila | ||
website: https://github.com/damianavila | ||
- header: "@drammock" | ||
image: https://avatars.githubusercontent.com/u/1810515 | ||
link: https://github.com/drammock | ||
website: https://github.com/drammock | ||
- header: "@choldgraf" | ||
image: https://avatars.githubusercontent.com/u/1839645 | ||
link: https://github.com/choldgraf | ||
website: https://github.com/choldgraf | ||
- header: "@12rambau" | ||
image: https://avatars.githubusercontent.com/u/12596392 | ||
link: https://github.com/12rambau | ||
website: https://github.com/12rambau |
This file contains 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 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 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 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
50 changes: 50 additions & 0 deletions
50
src/pydata_sphinx_theme/assets/styles/components/_searchbox.scss
This file contains 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* The 'Hide Search Matches' button. | ||
* This only shows up when a person lands on a page after clicking a search result. | ||
* Clicking it removes the highlighting of the search term from the page. | ||
* We want it to behave like a button. | ||
*/ | ||
div#searchbox { | ||
// Leave `#searchbox` rules empty so that it doesn't show at all when it is empty | ||
p.highlight-link { | ||
margin: 1rem 0; | ||
width: fit-content; | ||
|
||
// A bit more margin on wide screens to mimic article behavior | ||
@include media-breakpoint-up($breakpoint-sidebar-secondary) { | ||
margin-left: 2rem; | ||
} | ||
|
||
// Put outer shadow on this one so that we can darken the link w/ an inner shadow | ||
@include box-shadow(); | ||
|
||
// Style the button to look like a Sphinx Design button | ||
a { | ||
border-radius: 0.25rem; | ||
font-size: 1.25rem; | ||
padding: 0.75rem; | ||
background-color: var(--pst-color-primary); | ||
// Button text is always white with Sphinx Design buttons | ||
color: white; | ||
|
||
// The box shadow is inset so that it darkens the button on hover | ||
transition: box-shadow 0.25s ease-out; | ||
&:hover { | ||
box-shadow: inset 0px 0px 50px 50px rgba(0, 0, 0, 0.25); | ||
|
||
// Remove underline for link | ||
text-decoration: none; | ||
} | ||
|
||
// add icon via CSS because the link is created by javascript | ||
// match padding to .toc-item > i above | ||
&:before { | ||
content: var(--pst-icon-search-minus); | ||
color: unset; | ||
font-family: "Font Awesome 6 Free"; | ||
font-weight: 900; | ||
margin-right: 0.5rem; | ||
} | ||
} | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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