File tree 6 files changed +35
-21
lines changed
6 files changed +35
-21
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,9 @@ yarn type-check
26
26
yarn build
27
27
```
28
28
29
- ### Example
29
+ ### Demo
30
30
31
- <img width =" 949 " alt =" screen shot 2019-01-26 at 12 16 13 pm " src =" https://user-images.githubusercontent.com/236943/51792329-4b94cd00-2164-11e9-8228-7ed8b4a37afa.png " >
32
-
33
- <br />
34
- <br />
35
-
36
- <img width =" 949 " alt =" screen shot 2019-01-26 at 12 16 02 pm " src =" https://user-images.githubusercontent.com/236943/51792330-50598100-2164-11e9-9f3a-0f7189ffe5a5.png " >
31
+ ![ demo] ( https://user-images.githubusercontent.com/236943/51792565-abd93e00-2167-11e9-8bcb-87f7dccece52.gif )
37
32
38
33
<details >
39
34
<summary >Gatsby API Details</summary >
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Another entry
3
+ ---
4
+ <Button bg = " blue" >Hello page 2</Button >
5
+
6
+ ### And it works :)
Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ title: 'Edit mdx in NetlifyCMS! '
3
3
---
4
4
### This
5
5
6
- <h1 >is some jsx 2 </h1 >
6
+ <h1 >is some jsx</h1 >
7
7
8
- <Button bg = ' green ' >Hi Button</Button >
8
+ <Button bg = ' orange ' >Hello Button</Button >
Original file line number Diff line number Diff line change 4
4
* Since this file is shared with NetlifyCMS it must be .jsx
5
5
*/
6
6
7
- import React from "react"
8
- import styled , { ThemeProvider } from "styled-components"
7
+ import React , { Fragment } from "react"
8
+ import styled , { ThemeProvider , createGlobalStyle } from "styled-components"
9
9
import { Button } from "rebass"
10
10
11
11
export const theme = {
12
12
// TODO: https://rebassjs.org/theming
13
13
}
14
14
15
- const H1 = styled . h1 `
16
- font-size: 20px;
17
- `
15
+ const GlobalStyle = createGlobalStyle `
16
+ html, body {
17
+ font-family: Arial, Helvetica, sans-serif;
18
+ }
18
19
19
- const P = styled . div `
20
- font-size: 16px;
20
+ h3 {
21
+ font-family: Arial, Helvetica, sans-serif
22
+ }
21
23
`
22
24
23
25
export const LayoutComponents = {
24
- h1 : H1 ,
25
- p : P ,
26
+ h1 : styled . h1 `
27
+ font-size: 20px;
28
+ ` ,
29
+ p : styled . p `
30
+ font-size: 16px;
31
+ ` ,
26
32
}
27
33
28
34
export const UIComponents = {
29
35
Button : props => < Button { ...props } > { props . children } </ Button > ,
30
36
}
31
37
32
38
export const Theme = ( { children } ) => (
33
- < ThemeProvider theme = { theme } > { children } </ ThemeProvider >
39
+ < ThemeProvider theme = { theme } >
40
+ < Fragment >
41
+ < GlobalStyle />
42
+ { children }
43
+ </ Fragment >
44
+ </ ThemeProvider >
34
45
)
Original file line number Diff line number Diff line change @@ -54,7 +54,9 @@ const PreviewWindow = props => {
54
54
55
55
return (
56
56
< StyleSheetManager target = { iframeHeadElem } >
57
- < MdxPreview mdx = { mdxProps } { ...props } />
57
+ < Theme >
58
+ < MdxPreview mdx = { mdxProps } { ...props } />
59
+ </ Theme >
58
60
</ StyleSheetManager >
59
61
)
60
62
}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ backend:
10
10
repo : damassi/gatsby-typescript-netlify-starter
11
11
branch : master
12
12
13
- display_url : Gatsby Starter
13
+ display_url : http://localhost:8000
14
14
media_folder : static/assets
15
15
public_folder : assets
16
16
You can’t perform that action at this time.
0 commit comments