Skip to content

Commit

Permalink
fix minor graphiql style issues (#2712)
Browse files Browse the repository at this point in the history
* make sure hidden editors don't overflow their container
* fix hiding back link and title in docs
  • Loading branch information
thomasheyenbrock authored Aug 27, 2022
1 parent f15ee38 commit d65f00e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-wombats-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphiql/react': patch
---

Make sure the back link and title are hidden when focussing the input field for searching the docs
5 changes: 5 additions & 0 deletions .changeset/sweet-tomatoes-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphiql/react': patch
---

Make sure hidden editors don't overflow
2 changes: 2 additions & 0 deletions packages/graphiql-react/src/editor/style/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

&.hidden {
/* Just setting `display: none;` would break the editor gutters */
left: -9999px;
position: absolute;
top: -9999px;
visibility: hidden;
}
}
17 changes: 14 additions & 3 deletions packages/graphiql-react/src/explorer/components/doc-explorer.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@
justify-content: space-between;
position: relative;

&:focus-within .graphiql-doc-explorer-title {
/* Hide the header when focussing the search input */
visibility: hidden;
&:focus-within {
& .graphiql-doc-explorer-title {
/* Hide the header when focussing the search input */
visibility: hidden;
}

& .graphiql-doc-explorer-back:not(:focus) {
/**
* Make the back link invisible when focussing the search input. Hiding
* it in any other way makes it impossible to focus the link by pressing
* Shift-Tab while the input is focussed.
*/
color: transparent;
}
}
}
.graphiql-doc-explorer-header-content {
Expand Down

0 comments on commit d65f00e

Please sign in to comment.