Skip to content

Commit 234137d

Browse files
committed
Fixed light theme for tracing view. Closes #254
1 parent e9b01c9 commit 234137d

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import Results from './Results'
3838
import ReponseTracing from './ResponseTracing'
3939
import GenerateCodeButton from './GenerateCodeButton'
4040
import withTheme from '../Theme/withTheme'
41-
import { ThemeInterface } from '../Theme/index'
41+
import { LocalThemeInterface } from '../Theme/index'
4242

4343
/**
4444
* The top-level React component for GraphQLEditor, intended to encompass the entire
@@ -137,7 +137,7 @@ export interface ToolbarButtonProps extends SimpleProps {
137137
}
138138

139139
export class GraphQLEditor extends React.PureComponent<
140-
Props & ThemeInterface,
140+
Props & LocalThemeInterface,
141141
State
142142
> {
143143
static Logo: (props: SimpleProps) => JSX.Element

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import * as React from 'react'
2-
import styled from 'styled-components'
32
import { $v } from 'graphcool-styles'
43
import TracingRow from './TracingRow'
4+
import * as theme from 'styled-theming'
5+
import styled from '../../styled/styled'
56

67
export interface TracingFormat {
78
version: 1
@@ -27,10 +28,15 @@ export interface Props {
2728
endTime?: Date
2829
}
2930

31+
const textColor = theme('mode', {
32+
light: p => p.theme.colours.darkBlue60,
33+
dark: p => p.theme.colours.white,
34+
})
35+
3036
const TracingWrapper = styled.div`
3137
padding-top: 16px;
3238
padding-left: 25px;
33-
color: white;
39+
color: ${textColor};
3440
overflow: auto;
3541
`
3642

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
import * as React from 'react'
2-
import styled from 'styled-components'
2+
import * as theme from 'styled-theming'
3+
import styled from '../../styled/styled'
4+
5+
const textColor = theme('mode', {
6+
light: p => p.theme.colours.darkBlue60,
7+
dark: p => p.theme.colours.white,
8+
})
9+
10+
const durationColor = theme('mode', {
11+
light: p => p.theme.colours.darkBlue50,
12+
dark: p => p.theme.colours.white60,
13+
})
314

415
const Row = styled.div`
516
position: relative;
617
font-size: 12px;
718
display: table;
819
9-
color: white;
20+
color: ${textColor};
1021
`
1122

1223
const Bar = styled.span`
@@ -16,12 +27,12 @@ const Bar = styled.span`
1627
height: 1.5px;
1728
bottom: 4px;
1829
19-
background: white;
30+
background: ${textColor};
2031
`
2132

2233
const Duration = styled.span`
2334
font-size: 10px;
24-
color: rgba(255, 255, 255, 0.5);
35+
color: ${durationColor};
2536
`
2637

2738
const NameWrapper = styled.span`

packages/graphql-playground/src/styled/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface Colours {
77
darkBlue10: string
88
white60: string
99
white20: string
10+
white: string
1011
black40: string
1112
paleText: string
1213
paleGrey: string
@@ -21,6 +22,7 @@ export const colours: Colours = {
2122
darkBlue10: 'rgba(23, 42, 58, 0.1)',
2223
white20: 'rgba(255, 255, 255, 0.2)',
2324
white60: 'rgba(255, 255, 255, 0.6)',
25+
white: 'rgba(255, 255, 255, 1)',
2426
black40: 'rgba(0, 0, 0, 0.4)',
2527

2628
paleText: 'rgba(0, 0, 0, 0.5)',

0 commit comments

Comments
 (0)