GraphiQL styles (#3549)

This commit is contained in:
Bartłomiej Wiaduch 2023-05-04 17:09:10 +02:00 committed by GitHub
parent d9099b4022
commit 65a329ebe4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View file

@ -220,7 +220,7 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) {
return ( return (
<div <div
data-test-id="graphiql-container" data-test-id="graphiql-container"
className="graphiql-container" className={clsx("graphiql-container", classes.graphiqlContainer)}
style={rootStyle} style={rootStyle}
> >
<style dangerouslySetInnerHTML={overwriteCodeMirrorCSSVariables}></style> <style dangerouslySetInnerHTML={overwriteCodeMirrorCSSVariables}></style>
@ -273,7 +273,7 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) {
) : null} ) : null}
</div> </div>
<div ref={pluginResize.secondRef} style={{ minWidth: 0 }}> <div ref={pluginResize.secondRef} style={{ minWidth: 0 }}>
<div className="graphiql-sessions"> <div className={clsx("graphiql-sessions", classes.graphiqlSessions)}>
<div <div
role="tabpanel" role="tabpanel"
id="graphiql-session" id="graphiql-session"
@ -283,7 +283,10 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) {
> >
<div ref={editorResize.firstRef}> <div ref={editorResize.firstRef}>
<div <div
className="graphiql-editors full-height" className={clsx(
"graphiql-editors full-height",
classes.graphiqlEditors,
)}
style={{ boxShadow: "none" }} style={{ boxShadow: "none" }}
> >
<div ref={editorToolsResize.firstRef}> <div ref={editorToolsResize.firstRef}>

View file

@ -11,6 +11,10 @@ export const useStyles = makeStyles(
() => ({ () => ({
pre: { pre: {
whiteSpace: "break-spaces", whiteSpace: "break-spaces",
maxHeight: 450,
overflowY: "scroll",
marginBottom: 0,
marginTop: -26,
}, },
main: { main: {
position: "relative", position: "relative",
@ -22,6 +26,18 @@ export const useStyles = makeStyles(
overflowY: "scroll !important", overflowY: "scroll !important",
}, },
}, },
graphiqlSessions: {
margin: "0 !important",
marginRight: "var(--px-16) !important",
paddingTop: "var(--px-16)",
borderRadius: "0 !important",
},
graphiqlEditors: {
borderRadius: "0 !important",
},
graphiqlContainer: {
fontVariantLigatures: "none",
},
}), }),
{ name: "GraphiQL" }, { name: "GraphiQL" },
); );