Skip to content

Commit 4f97923

Browse files
committed
style: improve scrollbar styling on the query editor
This changes makes scrollbars in the graphiql editor transparent, so that they look better integrated in the interface
1 parent 03ab3a6 commit 4f97923

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.changeset/transparent-scrollbars.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@graphiql/react": patch
3+
"graphiql": patch
4+
---
5+
6+
style: improve scrollbar styling on the query editor

packages/graphiql-react/src/style/root.css

+28
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,31 @@ body.graphiql-dark [data-radix-popper-content-wrapper] {
146146
}
147147
}
148148
}
149+
150+
/* Transparent scrollbars, without backgrounds */
151+
.graphiql-container .CodeMirror-hscrollbar,
152+
.graphiql-container .CodeMirror-vscrollbar {
153+
scrollbar-color: #88888888 transparent;
154+
}
155+
156+
/* The little square between H and V scrollbars */
157+
.graphiql-container .CodeMirror-scrollbar-filler,
158+
.graphiql-container .CodeMirror-gutter-filler {
159+
background-color: transparent;
160+
}
161+
162+
/* Safari scrollbars */
163+
.graphiql-container .CodeMirror-hscrollbar::-webkit-scrollbar-track,
164+
.graphiql-container .CodeMirror-vscrollbar::-webkit-scrollbar-track,
165+
.graphiql-container .CodeMirror-hscrollbar::-webkit-scrollbar,
166+
.graphiql-container .CodeMirror-vscrollbar::-webkit-scrollbar{
167+
background-color: transparent;
168+
}
169+
170+
.graphiql-container .CodeMirror-hscrollbar::-webkit-scrollbar-thumb,
171+
.graphiql-container .CodeMirror-vscrollbar::-webkit-scrollbar-thumb {
172+
border-radius: 99px;
173+
padding: 3px;
174+
box-shadow: inset 0 0 99px 99px #88888888;
175+
border: solid 3px transparent;
176+
}

0 commit comments

Comments
 (0)