Skip to content
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

BUG - center search dialog on wide screens #2085

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 18 additions & 31 deletions src/pydata_sphinx_theme/assets/styles/components/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,39 +82,26 @@
/**
* The search modal <dialog>
*/
#pst-search-dialog {
display: none;

&[open] {
display: flex;

// Center in middle of screen just underneath header
position: fixed;
z-index: $zindex-modal;
top: 30%;
left: 50%;
transform: translate(-50%, -50%);
right: 1rem;
margin-top: 0.5rem;
width: 90%;
max-width: 800px;
background-color: transparent;
padding: $focus-ring-width;
border: none;

&::backdrop {
background-color: black;
opacity: 0.5;
}
#pst-search-dialog[open] {
margin: 25vh auto 0; // an open modal dialog has a fixed position, so these margins bring it 25% down the viewport height and center it horizontally
width: 90%;
max-width: 800px;
background-color: transparent;
padding: $focus-ring-width;
border: none;

&::backdrop {
background-color: black;
opacity: 0.5;
}

form.bd-search {
flex-grow: 1;
form.bd-search {
flex-grow: 1;

// Font and input text a bit bigger
svg,
input {
font-size: var(--pst-font-size-icon);
}
// Font and input text a bit bigger
svg,
input {
font-size: var(--pst-font-size-icon);
}
}
}
Expand Down
Loading