Skip to content

Commit

Permalink
chore: update dependencies to latest release (#94)
Browse files Browse the repository at this point in the history
* chore: update dependencies

* refactor: update order of deps to match pip output

* chore: fix favicon

* style: update css for updated theme

* fix: make search work properly with new theme

* style: fix sidebar
  • Loading branch information
thephez authored Dec 31, 2024
1 parent 38343af commit 57ca04d
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 127 deletions.
58 changes: 52 additions & 6 deletions _static/css/pydata-overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,65 @@

html[data-theme="light"] {
--pst-color-primary: var(--dash-blue);
--pst-color-secondary: var(--dash-blue);
--pst-color-link: var(--pst-color-primary);
--pst-color-link-hover: var(--dash-deep-blue);

.search-button-field:hover {
box-shadow: 0 0 0 .1875rem var(--pst-color-primary);
}

#pst-back-to-top:hover {
background-color: var(--pst-color-link-hover);
}
}

html[data-theme="dark"] {
--pst-color-primary: var(--dash-blue);
--pst-color-secondary: var(--pst-color-warning);
--pst-color-link: var(--pst-color-primary);
--pst-color-link-hover: var(--pst-color-warning)
--pst-color-link-hover: var(--pst-color-secondary);
--pst-color-table-row-hover-bg: var(--dash-deep-blue);

/* ReadTheDocs search addon CSS variables*/
/* See details on: https://github.com/readthedocs/addons/blob/0.23.2/src/search.css */
/* --readthedocs-search-color: darkgray;
--readthedocs-search-content-background-color: var(--bs-dark);
--readthedocs-search-content-border-color: gray; */
--readthedocs-search-input-background-color: darkgray;
/* --readthedocs-search-result-section-border-color: darkgray;
--readthedocs-search-result-section-subheading-color: darkgray;
--readthedocs-search-result-section-highlight-color: var(--dash-blue);
--readthedocs-search-filters-border-color: lightgray; */

/* Unused options */
/* --readthedocs-search-font-family, */
/* --readthedocs-search-font-size: 16px; */
/* --readthedocs-search-result-section-color: darkgray; doesn't seem to do anything*/
/* --readthedocs-search-footer-code-background-color, #fff */
/* --readthedocs-search-footer-background-color: rgb(234, 234, 234); */
/* --readthedocs-search-backdrop-color: rgba(0, 0, 0, 0.3); */

:host > div .results h2 {
color: lightgray;
}

select {
background-color: var(--pst-color-background);
}

.pst-navbar-icon:hover {
color: var(--pst-color-link-hover);
}

.pst-navbar-icon:hover:before {
border-bottom: max(3px,.1875rem,.12em) solid var(--pst-color-link-hover);
}

#pst-back-to-top:hover {
background-color: var(--pst-color-link-hover);
color: #000;
}
}

html {
Expand Down Expand Up @@ -52,11 +103,6 @@ ol {
font-family: 'Open Sans', sans-serif;
}

p {
font-size: 0.95em;
line-height: 1.5;
}

a.headerlink {
color: var(--pst-color-primary)
}
Expand Down
13 changes: 8 additions & 5 deletions _static/js/pydata-search-close.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Script to allow use of readthedocs-sphinx-search extension with the pydata theme
//
// Based in part on:
// https://github.com/pydata/pydata-sphinx-theme/blob/v0.13.3/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js#L167-L272
// https://github.com/pydata/pydata-sphinx-theme/blob/v0.16.1/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js#L177-L333

/*******************************************************************************
* Search
Expand All @@ -20,7 +20,7 @@ var findSearchInput = () => {
} else {
// must be at least one persistent form, use the first persistent one
form = document.querySelector(
"div:not(.search-button__search-container) > form.bd-search"
":not(#pst-search-dialog) > form.bd-search",
);
}
return form.querySelector("input");
Expand All @@ -30,11 +30,14 @@ var findSearchInput = () => {
// Hide Pydata theme's search
var hidePydataSearch = () => {
let input = findSearchInput();
let searchPopupWrapper = document.querySelector(".search-button__wrapper");
let hiddenInput = searchPopupWrapper.querySelector("input");

// if the input field is the hidden one (the one associated with the
// search button) then toggle the button state (to show/hide the field)
const searchDialog = document.getElementById("pst-search-dialog");
const hiddenInput = searchDialog.querySelector("input");

if (input === hiddenInput) {
searchPopupWrapper.classList.remove("show");
searchDialog.close();
}

if (document.activeElement === input) {
Expand Down
Loading

0 comments on commit 57ca04d

Please sign in to comment.