Skip to content

Commit 9eb9858

Browse files
committed
Improve project template on mobile
1 parent e5de64b commit 9eb9858

File tree

13 files changed

+117
-18
lines changed

13 files changed

+117
-18
lines changed

content/projects/comet/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ alternative platform that emphasized privacy and security.
2525

2626
<Columns>
2727

28-
<Column></Column>
28+
<ColumnSpacer />
2929
<TwoColumns>
3030

3131
## My First Web App
@@ -84,7 +84,7 @@ later.
8484

8585
<Columns>
8686

87-
<Column></Column>
87+
<ColumnSpacer />
8888

8989
<TwoColumns>
9090

content/projects/koi/index.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ resources.
3030
---
3131

3232
<Columns>
33-
<Column></Column>
33+
34+
<ColumnSpacer />
35+
3436
<TwoColumns>
3537

3638
## Design Mode
@@ -53,7 +55,7 @@ solutions. We're solving two different problems in two different places.
5355
</Columns>
5456

5557
<Columns>
56-
<Column></Column>
58+
<ColumnSpacer />
5759
<TwoColumns>
5860

5961
## Content Mode

content/projects/ncmg/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ and manage some generic site settings.
5252

5353
<Columns>
5454

55-
<Column></Column>
55+
<ColumnSpacer />
5656

5757
<TwoColumns>
5858

src/components/ContactForm.treat.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
/** @format */
22

3-
import { style, globalStyle } from 'treat'
3+
import { style } from 'treat'
44
import { snap } from '../app/constants'
55

66
export const form = style((theme) => ({
77
// Box model
8-
padding: '2rem',
8+
padding: '1.5rem',
99
maxWidth: 410,
1010

1111
// Visuals
1212
background: theme.grey90,
1313
borderRadius: 4,
14+
15+
'@media': {
16+
'(min-width: 650px)': {
17+
padding: '2rem',
18+
},
19+
},
1420
}))
1521

1622
export const field = style((theme) => ({

src/components/Project.treat.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,22 @@ export const project = style((theme) => ({
1313
}))
1414

1515
globalStyle(`${project} hr`, (theme) => ({
16-
margin: '8rem 0',
16+
// Box model
17+
margin: '4rem 0',
18+
19+
// Typography
20+
color: theme.grey70,
21+
22+
// Visuals
1723
border: 0,
1824
borderBottom: '4px solid',
1925
borderBottomColor: 'currentcolor',
20-
color: theme.grey70,
26+
27+
'@media': {
28+
'(min-width: 650px)': {
29+
margin: '8rem 0',
30+
},
31+
},
2132
}))
2233

2334
globalStyle(`${project} a`, (theme) => ({

src/components/Project.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { FluidImage } from '../app/types'
88
import * as styleRefs from './Project.treat'
99

1010
import Column from './Project/Column'
11+
import ColumnSpacer from './Project/ColumnSpacer'
1112
import Columns from './Project/Columns'
1213
import Header from './Project/Header'
1314
import IncompleteWarning from './Project/IncompleteWarning'
@@ -23,6 +24,7 @@ interface ComponentMap {
2324
}
2425

2526
const components: ComponentMap = {
27+
ColumnSpacer,
2628
Column,
2729
Columns,
2830
IncompleteWarning,
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/** @format */
2+
3+
import { style } from 'treat'
4+
5+
export const spacer = style({
6+
display: 'none',
7+
8+
'@media': {
9+
'(min-width: 650px)': {
10+
display: 'block',
11+
gridColumn: 'span 1',
12+
},
13+
},
14+
})
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/** @format */
2+
3+
import React from 'react'
4+
import * as styles from './ColumnSpacer.treat'
5+
6+
function ColumnSpacer() {
7+
return <div className={styles.spacer} />
8+
}
9+
10+
export default ColumnSpacer

src/components/Project/Columns.treat.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ import { style, globalStyle } from 'treat'
44

55
export const columns = style({
66
display: 'grid',
7-
gridTemplateColumns: 'repeat(3, 1fr)',
7+
gridTemplateColumns: '1fr',
88
gridGap: '3rem',
99
margin: '3rem 0',
10+
11+
'@media': {
12+
'(min-width: 650px)': {
13+
gridTemplateColumns: 'repeat(2, 1fr)',
14+
},
15+
16+
'(min-width: 1000px)': {
17+
gridTemplateColumns: 'repeat(3, 1fr)',
18+
}
19+
}
1020
})
1121

1222
globalStyle(`${columns} > p`, {

src/components/Project/IncompleteWarning.treat.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,31 @@ import { style } from 'treat'
44

55
export const wrapper = style((theme) => ({
66
// Box model
7-
display: 'grid',
8-
gridTemplateColumns: '48px 1fr',
9-
gridGap: '1.5rem',
7+
display: 'block',
108
alignItems: 'center',
119
padding: '1.5rem 2rem',
1210
marginTop: '2rem',
1311

1412
// Visuals
1513
background: theme.grey90,
1614
borderRadius: 3,
15+
16+
'@media': {
17+
'(min-width: 650px)': {
18+
// Box model
19+
display: 'grid',
20+
gridTemplateColumns: '48px 1fr',
21+
gridGap: '1.5rem',
22+
},
23+
},
1724
}))
1825

1926
export const icon = style((theme) => ({
2027
// Box model
2128
padding: '0.75rem',
29+
width: 48,
30+
height: 48,
31+
marginBottom: '1rem',
2232

2333
// Typography
2434
color: theme.primary,
@@ -27,6 +37,12 @@ export const icon = style((theme) => ({
2737
// Visuals
2838
background: theme.grey80,
2939
borderRadius: '50%',
40+
41+
'@media': {
42+
'(min-width: 650px)': {
43+
marginBottom: 0,
44+
}
45+
}
3046
}))
3147

3248
export const iconInner = style({

0 commit comments

Comments
 (0)