From 019ad5165871a6605f379f42fb11009ffd02839e Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:17:15 +0200 Subject: [PATCH] Remove shortcut indicator search dialog on small screens (#1947) Closes #1944. Alternative to #1945. While #1945 removes the shortcut completely, I've [suggested that it actually has value](https://github.com/pydata/pydata-sphinx-theme/pull/1945#issuecomment-2268537495) and should only be removed on smaller screens. That's what this PR implements. It shows the shortcuts if the window size is at least "md" i.e. >=768px (I figured, this is a reasonable threshold - see discussion below, but if you think other values are better, that's perfectly fine). See pull requests for screenshots. --- .../assets/styles/components/_search.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pydata_sphinx_theme/assets/styles/components/_search.scss b/src/pydata_sphinx_theme/assets/styles/components/_search.scss index e75b08d72..630c6cd1f 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_search.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_search.scss @@ -61,9 +61,13 @@ // Shows off the keyboard shortcuts for the button .search-button__kbd-shortcut { - display: flex; + display: none; margin-inline-end: 0.5rem; color: var(--pst-color-border); + + @include media-breakpoint-up(md) { + display: flex; + } } }