Skip to content

Commit 5653075

Browse files
committed
Fix light theme spacing. Closes #256
1 parent ee4e46b commit 5653075

File tree

5 files changed

+27
-46
lines changed

5 files changed

+27
-46
lines changed

packages/graphql-playground/src/components/HistoryPopup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as Modal from 'react-modal'
33
import HistoryHeader from './HistoryPopup/HistoryHeader'
44
import { HistoryFilter, Session } from '../types'
55
import HistoryItems from './HistoryPopup/HistoryItems'
6-
import { GraphQLEditor } from './Playground/GraphQLEditor'
6+
import GraphQLEditor from './Playground/GraphQLEditor'
77
import { $v, Icon } from 'graphcool-styles'
88
import { modalStyle } from '../constants'
99
import { withTheme, ThemeInterface } from './Theme'

packages/graphql-playground/src/components/Playground/GraphQLEditor.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ import { flatMap, groupBy } from 'lodash'
3737
import Results from './Results'
3838
import ReponseTracing from './ResponseTracing'
3939
import GenerateCodeButton from './GenerateCodeButton'
40+
import withTheme from '../Theme/withTheme'
41+
import { ThemeInterface } from '../Theme/index'
4042

4143
/**
4244
* The top-level React component for GraphQLEditor, intended to encompass the entire
@@ -132,7 +134,10 @@ export interface ToolbarButtonProps extends SimpleProps {
132134
label: string
133135
}
134136

135-
export class GraphQLEditor extends React.PureComponent<Props, State> {
137+
export class GraphQLEditor extends React.PureComponent<
138+
Props & ThemeInterface,
139+
State
140+
> {
136141
static Logo: (props: SimpleProps) => JSX.Element
137142
static Toolbar: (props: SimpleProps) => JSX.Element
138143
static Footer: (props: SimpleProps) => JSX.Element
@@ -392,6 +397,9 @@ export class GraphQLEditor extends React.PureComponent<Props, State> {
392397
@p: .relative;
393398
border-top: 8px solid $darkBlue;
394399
}
400+
.queryWrap.light {
401+
border-top: 8px solid #eeeff0;
402+
}
395403
396404
.graphiql-button {
397405
@p: .white50, .bgDarkBlue, .ttu, .f14, .fw6, .br2, .pointer;
@@ -470,7 +478,10 @@ export class GraphQLEditor extends React.PureComponent<Props, State> {
470478
className="editorBar"
471479
onMouseDown={this.handleResizeStart}
472480
>
473-
<div className="queryWrap" style={queryWrapStyle}>
481+
<div
482+
className={cn('queryWrap', this.props.localTheme)}
483+
style={queryWrapStyle}
484+
>
474485
<QueryEditor
475486
ref={this.setQueryEditorComponent}
476487
schema={this.state.schema}
@@ -1410,6 +1421,8 @@ export class GraphQLEditor extends React.PureComponent<Props, State> {
14101421
}
14111422
}
14121423

1424+
export default withTheme<Props>(GraphQLEditor)
1425+
14131426
// Duck-type promise detection.
14141427
function isPromise(value) {
14151428
return typeof value === 'object' && typeof value.then === 'function'

packages/graphql-playground/src/components/Playground/GraphQLEditorSession.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import { PermissionSession, ServiceInformation, Session } from '../../types'
3-
import { GraphQLEditor } from './GraphQLEditor'
3+
import GraphQLEditor from './GraphQLEditor'
44
import { Header } from './HttpHeaders/HttpHeaders'
55
import { Viewer } from '../Playground'
66

packages/graphql-playground/src/components/Playground/TabBar.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ export const TabBar = withTheme<Props>(
161161
height: 8px;
162162
background-color: #eeeff0;
163163
width: 100%;
164+
top: -2px;
165+
position: relative;
164166
}
165167
.tab:hover {
166168
@p: .bgDarkBlue;

packages/graphql-playground/src/styles/graphiql_light.css

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
}
135135

136136
.docs-graphiql .graphiql-container .queryWrap {
137-
border: none;
138137
display: -webkit-box;
139138
display: -ms-flexbox;
140139
display: flex;
@@ -209,7 +208,7 @@
209208
}
210209

211210
.docs-graphiql .graphiql-container .variable-editor .CodeMirror {
212-
background: rgba(0,0,0,.05) !important;
211+
background: transparent !important;
213212
}
214213

215214
.docs-graphiql .graphiql-container .variable-editor .CodeMirror-gutters {
@@ -233,13 +232,17 @@
233232
}
234233

235234
.docs-graphiql .variable-editor {
235+
background: rgba(0,0,0,.05);
236236
height: 44px;
237237
}
238238

239-
.docs-graphiql .graphiql-container .variable-editor-title {
240-
padding: 12px 15px 13px;
241-
line-height: 19px;
239+
.docs-graphiql .graphiql-container .response-tracing {
242240
background: rgba(0,0,0,.05);
241+
}
242+
243+
.docs-graphiql .graphiql-container .variable-editor-title,
244+
.docs-graphiql .graphiql-container .response-tracing-title {
245+
background: none;
243246
color: rgba(0,0,0,.3);
244247
}
245248

@@ -401,38 +404,10 @@
401404

402405
.docs-graphiql .graphiql-container .CodeMirror {
403406
color: rgba(255,255,255,.3);
404-
font-family:
405-
'Source Code Pro',
406-
'Consolas',
407-
'Inconsolata',
408-
'Droid Sans Mono',
409-
'Monaco',
410-
monospace;
411-
font-size: 14px;
412-
height: 100%;
413-
left: 0;
414-
position: absolute;
415-
top: 0;
416-
width: 100%;
417-
}
418-
419-
.docs-graphiql .graphiql-container .CodeMirror-lines {
420-
padding: 0;
421407
}
422408

423409
.docs-graphiql .CodeMirror-hint-information .content {
424-
box-orient: vertical;
425410
color: #141823;
426-
display: -webkit-box;
427-
display: -ms-flexbox;
428-
display: flex;
429-
font-family: system, -apple-system, 'San Francisco', '.SFNSDisplay-Regular', 'Segoe UI', Segoe, 'Segoe WP', 'Helvetica Neue', helvetica, 'Lucida Grande', arial, sans-serif;
430-
font-size: 13px;
431-
line-clamp: 3;
432-
line-height: 16px;
433-
max-height: 48px;
434-
overflow: hidden;
435-
text-overflow: -o-ellipsis-lastline;
436411
}
437412

438413
.docs-graphiql .CodeMirror-hint-information .content p:first-child {
@@ -632,15 +607,6 @@
632607
height: auto;
633608
}
634609

635-
/* PADDING */
636-
637-
.docs-graphiql .CodeMirror-lines {
638-
padding: 4px 0; /* Vertical padding around content */
639-
}
640-
.docs-graphiql .CodeMirror pre {
641-
padding: 0 4px; /* Horizontal padding of content */
642-
}
643-
644610
.docs-graphiql .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
645611
background-color: white; /* The little square between H and V scrollbars */
646612
}

0 commit comments

Comments
 (0)