Skip to content

Commit

Permalink
move editor styles to @graphiql/react (#2532)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheyenbrock committed Aug 24, 2022
1 parent 6cf88e2 commit e5a289b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useHeaderEditor, UseHeaderEditorArgs } from '../header-editor';

import '../style/codemirror.css';
import '../style/fold.css';
import '../style/editor.css';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../style/hint.css';
import '../style/info.css';
import '../style/jump.css';
import '../style/auto-insertion.css';
import '../style/editor.css';

export function QueryEditor(props: UseQueryEditorArgs) {
const ref = useQueryEditor(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useResponseEditor, UseResponseEditorArgs } from '../response-editor';
import '../style/codemirror.css';
import '../style/fold.css';
import '../style/info.css';
import '../style/editor.css';

export function ResponseEditor(props: UseResponseEditorArgs) {
const ref = useResponseEditor(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import '../style/codemirror.css';
import '../style/fold.css';
import '../style/lint.css';
import '../style/hint.css';
import '../style/editor.css';

type VariableEditorProps = UseVariableEditorArgs & {
isHidden?: boolean;
Expand Down
10 changes: 10 additions & 0 deletions packages/graphiql-react/src/editor/style/editor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.graphiql-editor {
height: 100%;
position: relative;

&.hidden {
/* Just setting `display: none;` would break the editor gutters */
position: absolute;
visibility: hidden;
}
}
11 changes: 0 additions & 11 deletions packages/graphiql/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@
padding: var(--px-16);
}

/* Any codemirror editor */
.graphiql-container .graphiql-editor {
height: 100%;
position: relative;
}
.graphiql-container .graphiql-editor.hidden {
/* Just setting `display: none;` would break the editor gutters */
position: absolute;
visibility: hidden;
}

/* The tab bar for editor tools */
.graphiql-container .graphiql-editor-tools {
align-items: center;
Expand Down

0 comments on commit e5a289b

Please sign in to comment.