Skip to content

Commit 60d085f

Browse files
authored
fix: stop the closed search box from covering the GitHub button (#69)
On the home page, clicking the left part of the GitHub button in the header focused the search input and opened search, and hovering it showed the browser's "Please fill out this field" tooltip. Only the right part of the button opened GitHub. Closed, the search form is a 44px button, but Material's `.md-search__input` and `.md-search__suggest` keep their `2.2rem` side padding, so they are 88px wide and stick out 44px to the right. The input has `z-index: 2`, so the overflow sat on top of the GitHub button next to it. This clips the closed form with `overflow: hidden`; the open form (560px) is unchanged. Checked with `mkdocs serve` at 965, 1024 and 1440px wide: `elementFromPoint` across the GitHub button now returns the link at every point (before: the search input over its left 30%), the search icon still opens search, and a query still returns results. Inner pages don't use this header.
1 parent a104953 commit 60d085f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎docs/stylesheets/home.css‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,15 @@
254254
border-radius: 12px 12px 0 0;
255255
}
256256

257+
/*
258+
* Closed, the form is a 44px button, but the input and the suggestion
259+
* layer keep Material's padding and are 88px wide. Clip them so they do
260+
* not cover the GitHub button next to it.
261+
*/
262+
[data-md-toggle="search"]:not(:checked) ~ .cl-header .md-search__form {
263+
overflow: hidden;
264+
}
265+
257266
.cl-header .md-search__input {
258267
color: var(--cl-ink);
259268
font-family: var(--cl-text);

0 commit comments

Comments
 (0)