Skip to content

Commit

Permalink
style: improve scrollbar styling on the query editor
Browse files Browse the repository at this point in the history
This changes makes scrollbars in the graphiql editor transparent, so that they look better integrated in the interface
  • Loading branch information
TPXP committed May 20, 2024
1 parent 03ab3a6 commit 0926501
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/transparent-scrollbars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphiql/react": patch
"graphiql": patch
---

style: improve scrollbar styling on the query editor
32 changes: 32 additions & 0 deletions packages/graphiql-react/src/style/root.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,35 @@ body.graphiql-dark [data-radix-popper-content-wrapper] {
}
}
}

/* Transparent scrollbars, without backgrounds */
.graphiql-container .CodeMirror-hscrollbar,
.graphiql-container .CodeMirror-vscrollbar,
.graphiql-container .graphiql-plugin {
scrollbar-color: #88888888 transparent;
}

/* The little square between H and V scrollbars */
.graphiql-container .CodeMirror-scrollbar-filler,
.graphiql-container .CodeMirror-gutter-filler {
background-color: transparent;
}

/* Safari scrollbars */
.graphiql-container .CodeMirror-hscrollbar::-webkit-scrollbar-track,
.graphiql-container .CodeMirror-vscrollbar::-webkit-scrollbar-track,
.graphiql-container .graphiql-plugin::-webkit-scrollbar-track,
.graphiql-container .CodeMirror-hscrollbar::-webkit-scrollbar,
.graphiql-container .CodeMirror-vscrollbar::-webkit-scrollbar,
.graphiql-container .graphiql-plugin::-webkit-scrollbar {
background-color: transparent;
}

.graphiql-container .CodeMirror-hscrollbar::-webkit-scrollbar-thumb,
.graphiql-container .CodeMirror-vscrollbar::-webkit-scrollbar-thumb,
.graphiql-container .graphiql-plugin::-webkit-scrollbar-thumb {
border-radius: 99px;
padding: 3px;
box-shadow: inset 0 0 99px 99px #88888888;
border: solid 3px transparent;
}

0 comments on commit 0926501

Please sign in to comment.