Skip to content

Commit 2bc467c

Browse files
committed
style: improve explorer styling
Various fixes on the schema explorer styling: * Correct characters overflowing some inputs in Safari * Fix background color not being set in query fields on dark mode * Enhance font style for test inputs * Improve scrollbar styling * Reorganize UI to have scrollbars on query content only * Correct flickering of some lines when hovering in safari
1 parent 03ab3a6 commit 2bc467c

File tree

3 files changed

+53
-5
lines changed

3 files changed

+53
-5
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphiql/plugin-explorer": patch
3+
---
4+
5+
style: styling improvements on the schema explorer

packages/graphiql-plugin-explorer/src/index.css

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.docExplorerWrap {
2-
height: unset !important;
3-
min-width: unset !important;
2+
height: 100% !important;
3+
min-width: auto !important;
44
width: unset !important;
55
}
66

@@ -17,22 +17,65 @@
1717
font-family: var(--font-family-mono) !important;
1818
font-size: var(--font-size-body) !important;
1919
padding: 0 !important;
20+
flex: 1;
2021
}
2122

2223
.graphiql-explorer-root > div:first-child {
2324
padding-left: var(--px-8);
24-
overflow: hidden !important;
25+
overflow: auto !important;
26+
scrollbar-color: #88888888 transparent;
27+
}
28+
29+
/* Safari scrollbars */
30+
.graphiql-explorer-root>div:first-child::-webkit-scrollbar-track,
31+
.graphiql-explorer-root>div:first-child::-webkit-scrollbar,
32+
.graphiql-explorer-root>div:first-child::-webkit-scrollbar-corner{
33+
background-color: transparent;
34+
}
35+
36+
.graphiql-explorer-root>div:first-child::-webkit-scrollbar-thumb {
37+
border-radius: 99px;
38+
padding: 3px;
39+
box-shadow: inset 0 0 99px 99px #88888888;
40+
border: solid 3px transparent;
2541
}
2642

2743
.graphiql-explorer-root input {
2844
background: hsl(var(--color-base));
45+
padding: 1px 0;
46+
font-family: inherit;
2947
}
3048

3149
.graphiql-explorer-root select {
32-
background-color: hsl(var(--color-base));
50+
background-color: hsl(var(--color-base)) !important;
3351
border: 1px solid hsla(var(--color-neutral), var(--alpha-secondary));
3452
border-radius: var(--border-radius-4);
3553
color: hsl(var(--color-neutral));
3654
margin: 0 var(--px-4);
3755
padding: var(--px-4) var(--px-6);
3856
}
57+
58+
.doc-explorer-contents {
59+
flex:1;
60+
display: flex;
61+
flex-direction: column;
62+
overflow: auto !important;
63+
}
64+
65+
.doc-explorer-title-bar {
66+
flex: 0;
67+
}
68+
69+
.graphiql-explorer-root > div:last-child {
70+
min-height: auto !important;
71+
max-height: auto !important;
72+
flex: 0;
73+
}
74+
75+
.graphiql-explorer-root .graphiql-operation-title-bar button {
76+
padding: 1px 6px;
77+
}
78+
79+
.graphiql-explorer-root .graphiql-explorer-node button {
80+
padding: 1px 6px;
81+
}

packages/graphiql-plugin-explorer/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const styles = {
106106
fontSize: '1em',
107107
},
108108
explorerActionsStyle: {
109-
padding: 'var(--px-8) var(--px-4)',
109+
padding: 'var(--px-8) var(--px-4) 0',
110110
},
111111
actionButtonStyle: {
112112
backgroundColor: 'transparent',

0 commit comments

Comments
 (0)