Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit 43c3705

Browse files
committed
Adjusts styles and plays with colors.
1 parent 845f7f4 commit 43c3705

File tree

11 files changed

+65
-41
lines changed

11 files changed

+65
-41
lines changed

src/renderer/features/example-using-tabs/fun-dog/fun-dog.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import * as React from 'react'
22
import dogImage from './fun-dog.jpg'
3-
import { cssProps } from '../../../platform'
3+
import { cssProps, colors } from '../../../platform'
44
import { css } from 'glamor'
55

66
const ROOT = cssProps({
77
width: 300,
88
borderStyle: 'solid',
9-
borderWidth: 1,
9+
borderWidth: 2,
10+
borderColor: colors.line,
11+
borderRadius: 4,
1012
})
1113

1214
export function FunDog() {

src/renderer/features/example-using-tabs/header/header.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ const ROOT = compose(
99
cssProps({
1010
textAlign: 'center',
1111
paddingTop: spacing.verySmall,
12-
backgroundColor: colors.headerBg,
13-
fontSize: fontSizes.small,
12+
backgroundColor: colors.navBackground,
13+
color: colors.navLine,
14+
fontSize: fontSizes.medium,
1415
}),
1516
)
1617

src/renderer/features/example-using-tabs/welcome-screen/sample-tabs.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,18 @@ const KEY_2 = `${commandOrControlKey}+2`
2323
const KEY_3 = `${commandOrControlKey}+3`
2424

2525
const ROOT = compose(
26+
styles.windowDrag,
2627
styles.row,
2728
cssProps({
2829
paddingLeft: spacing.medium,
2930
paddingRight: spacing.medium,
30-
backgroundColor: colors.headerBg,
31+
paddingTop: spacing.small,
32+
backgroundColor: colors.navBackground,
33+
justifyContent: 'center',
34+
borderBottom: 1,
35+
borderBottomColor: colors.line,
36+
borderBottomStyle: 'solid',
37+
boxShadow: `0px 2px 10px ${colors.navBackground}`,
3138
}),
3239
)
3340

@@ -52,9 +59,9 @@ export class SampleTabs extends React.PureComponent<SampleTabsProps, {}> {
5259
const { tab } = this.props
5360
return (
5461
<div {...css(ROOT)}>
55-
<Tab onClick={this.changeTab1} active={tab === 'one'} text='Random Dog' />
56-
<Tab onClick={this.changeTab2} active={tab === 'two'} text='Long Content' />
57-
<Tab onClick={this.changeTab3} active={tab === 'three'} text='Empty' />
62+
<Tab onClick={this.changeTab1} active={tab === 'one'} text='doggo' />
63+
<Tab onClick={this.changeTab2} active={tab === 'two'} text='paragraphs' />
64+
<Tab onClick={this.changeTab3} active={tab === 'three'} text='empty' />
5865
</div>
5966
)
6067
}

src/renderer/features/example-using-tabs/welcome-screen/welcome-screen.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as React from 'react'
22
import { SampleTabs, SampleTabType } from './sample-tabs'
33
import { LongTab } from '../long-tab'
44
import { DogTab } from '../dog-tab'
5-
import { Header } from '../header'
65
import { styles, cssProps } from '../../../platform'
76
import Store = require('electron-store')
87
import { css } from 'glamor'
@@ -40,7 +39,6 @@ export class WelcomeScreen extends React.Component<{}, WelcomeScreenState> {
4039
render() {
4140
return (
4241
<div id='WelcomeScreen' {...css(styles.column, styles.flex1)}>
43-
<Header />
4442
<SampleTabs tab={this.state.tab} onChangeTab={this.setTab} />
4543
<DogTab style={this.state.tab !== 'one' && HIDDEN} />
4644
<LongTab style={this.state.tab !== 'two' && HIDDEN} />

src/renderer/platform/components/tab/tab.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,33 @@ const BASE = compose(
1414
styles.noWindowDrag,
1515
cssProps({
1616
cursor: 'pointer',
17-
padding: spacing.small,
18-
fontSize: fontSizes.default,
17+
paddingTop: spacing.small,
18+
paddingBottom: spacing.small,
19+
paddingLeft: spacing.medium,
20+
paddingRight: spacing.medium,
1921
}),
2022
)
2123

2224
const ACTIVE = cssProps({
23-
color: colors.primary,
24-
borderBottom: colors.primary,
25+
borderBottom: colors.line,
2526
borderBottomWidth: 2,
2627
borderBottomStyle: 'solid',
2728
})
2829

30+
const BASE_TEXT = cssProps({ color: colors.navInactive, fontSize: fontSizes.mediumPlus })
31+
const ACTIVE_TEXT = cssProps({ color: colors.navActive })
32+
2933
/**
3034
* A tab component that you click on. Not the tab panel.
3135
*/
3236
export function Tab(props: TabProps) {
3337
// work out the styles
3438
const styleProps = css(BASE, props.active && ACTIVE, props.style)
39+
const textStyle = css(BASE_TEXT, props.active && ACTIVE_TEXT)
3540

3641
return (
3742
<div {...styleProps} onClick={props.onClick}>
38-
<Text text={props.text} />
43+
<Text style={textStyle} text={props.text} />
3944
</div>
4045
)
4146
}

src/renderer/platform/components/text/text.test.js.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ Generated by [AVA](https://ava.li).
99
> Snapshot 1
1010
1111
<p
12-
"data-css-6etoft"=""
12+
"data-css-f6nk39"=""
1313
/>
1414

1515
## children have priority over text
1616

1717
> Snapshot 1
1818
1919
<p
20-
"data-css-6etoft"=""
20+
"data-css-f6nk39"=""
2121
>
2222
one
2323
</p>
@@ -27,7 +27,7 @@ Generated by [AVA](https://ava.li).
2727
> Snapshot 1
2828
2929
<p
30-
"data-css-6etoft"=""
30+
"data-css-f6nk39"=""
3131
>
3232
hi
3333
</p>
@@ -37,7 +37,7 @@ Generated by [AVA](https://ava.li).
3737
> Snapshot 1
3838
3939
<p
40-
"data-css-6etoft"=""
40+
"data-css-f6nk39"=""
4141
>
4242
hello
4343
</p>
@@ -47,7 +47,7 @@ Generated by [AVA](https://ava.li).
4747
> Snapshot 1
4848
4949
<p
50-
"data-css-1sxkrsg"=""
50+
"data-css-19csgvw"=""
5151
>
5252
one
5353
</p>
Binary file not shown.

src/renderer/platform/components/text/text.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import { CSSProperties } from 'react'
3-
import { fonts, fontSizes, cssProps } from '../..'
3+
import { colors, fonts, fontSizes, cssProps } from '../..'
44
import { css } from 'glamor'
55

66
export interface TextProps {
@@ -10,7 +10,8 @@ export interface TextProps {
1010
}
1111

1212
const STYLE = cssProps({
13-
fontSize: fontSizes.default,
13+
color: colors.text,
14+
fontSize: fontSizes.medium,
1415
fontFamily: fonts.default,
1516
padding: 0,
1617
margin: 0,

src/renderer/platform/theme/colors.ts

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
* Named colours.
33
*/
44
const palette = {
5-
blue: '#66d',
5+
bluez: ['#2B3A45', '#56748A', '#9CD4FC', '#D2EBFD', '#EDF7FE'],
6+
beige: ['#383330', '#585350', '#a8a3a0', '#d8d3d0', '#f8f3f0'],
7+
mint: ['#385350', '#587370', '#a8c3c0', '#d8e3e0', '#f8ffff'],
8+
purps: ['#503853', '#705873', '#c0a8c3', '#e0d8e3', '#fff8ff'],
9+
grayscale: ['#1d1d1d', '#2d2d2d', '#333', '#666', '#888', '#aaa', '#ddd', '#e6e6e6', '#f0f0f0'],
610
cherry: '#d44',
7-
white: '#fff',
8-
offWhite: '#f0f0f0',
9-
neutral: '#999',
10-
offBlack: '#222',
11-
black: '#000',
1211
}
1312

13+
/**
14+
* The dominant color scale.
15+
*/
16+
const dominant = palette.beige
17+
1418
/**
1519
* These are the various roles that colour plays in the system.
1620
*/
@@ -24,20 +28,25 @@ export const colors = {
2428
/**
2529
* The default dackground color.
2630
*/
27-
background: palette.white,
31+
background: dominant[4],
2832

29-
/**
30-
* The header background color.
33+
/**
34+
* The background color navigation.
3135
*/
32-
headerBg: palette.white,
36+
navBackground: dominant[2],
37+
/** the line color of the nav */
38+
navLine: dominant[1],
39+
/** Navigation foreground when it isn't active. */
40+
navInactive: dominant[3],
41+
/** Navigation foreground when active. */
42+
navActive: dominant[1],
3343

34-
/**
35-
* The predominant colour.
36-
*/
37-
primary: palette.blue,
44+
/** Normal reading text. */
45+
text: palette.grayscale[2],
3846

39-
/**
40-
* When something goes wrong.
41-
*/
47+
/** When something goes wrong. */
4248
error: palette.cherry,
49+
50+
/** Subtle lines like dividers. */
51+
line: dominant[1],
4352
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export const fontSizes = {
22
small: 12,
3-
default: 16,
3+
medium: 15,
4+
mediumPlus: 18,
45
}

0 commit comments

Comments
 (0)