Skip to content

Commit a268531

Browse files
move editor styles to @graphiql/react (#2532)
1 parent 1d61145 commit a268531

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

packages/graphiql-react/src/editor/components/header-editor.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useHeaderEditor, UseHeaderEditorArgs } from '../header-editor';
22

33
import '../style/codemirror.css';
44
import '../style/fold.css';
5+
import '../style/editor.css';
56

67
type HeaderEditorProps = UseHeaderEditorArgs & { isHidden?: boolean };
78

packages/graphiql-react/src/editor/components/query-editor.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import '../style/hint.css';
77
import '../style/info.css';
88
import '../style/jump.css';
99
import '../style/auto-insertion.css';
10+
import '../style/editor.css';
1011

1112
export function QueryEditor(props: UseQueryEditorArgs) {
1213
const ref = useQueryEditor(props);

packages/graphiql-react/src/editor/components/response-editor.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useResponseEditor, UseResponseEditorArgs } from '../response-editor';
33
import '../style/codemirror.css';
44
import '../style/fold.css';
55
import '../style/info.css';
6+
import '../style/editor.css';
67

78
export function ResponseEditor(props: UseResponseEditorArgs) {
89
const ref = useResponseEditor(props);

packages/graphiql-react/src/editor/components/variable-editor.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import '../style/codemirror.css';
44
import '../style/fold.css';
55
import '../style/lint.css';
66
import '../style/hint.css';
7+
import '../style/editor.css';
78

89
type VariableEditorProps = UseVariableEditorArgs & {
910
isHidden?: boolean;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.graphiql-editor {
2+
height: 100%;
3+
position: relative;
4+
5+
&.hidden {
6+
/* Just setting `display: none;` would break the editor gutters */
7+
position: absolute;
8+
visibility: hidden;
9+
}
10+
}

packages/graphiql/src/style.css

-11
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@
3131
padding: var(--px-16);
3232
}
3333

34-
/* Any codemirror editor */
35-
.graphiql-container .graphiql-editor {
36-
height: 100%;
37-
position: relative;
38-
}
39-
.graphiql-container .graphiql-editor.hidden {
40-
/* Just setting `display: none;` would break the editor gutters */
41-
position: absolute;
42-
visibility: hidden;
43-
}
44-
4534
/* The tab bar for editor tools */
4635
.graphiql-container .graphiql-editor-tools {
4736
align-items: center;

0 commit comments

Comments
 (0)