Skip to content

Commit 6109f6a

Browse files
authored
Merge branch 'master' into patch-5
2 parents 786f16e + a34483b commit 6109f6a

File tree

39 files changed

+6585
-1232
lines changed

39 files changed

+6585
-1232
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
- Removes overriding property on editor combobox
66
- Adjust media query sort logic #600
77
- Fixed link to Gatsby Plugin page in `getting-started` page. Issue #602
8+
- Fix broken base-preset link on `theming` page
89

9-
## v0.3.0 2019-01-22
10+
## v0.3.0 2020-01-22
1011

1112
- Split theme-ui package into `@theme-ui/core`, `@theme-ui/mdx`, and `@theme-ui/color-modes`
1213
- Removes `context.components` (still available through MDX context)

examples/next/components/Header.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import React from 'react'
2-
import { useColorMode } from 'theme-ui'
2+
import { Button, useColorMode } from 'theme-ui'
33

4-
export default function Header() {
4+
const Header = () => {
55
const [colorMode, setColorMode] = useColorMode()
66
return (
77
<header>
8-
<button
8+
<Button
99
onClick={() => setColorMode(colorMode === 'light' ? 'dark' : 'light')}>
1010
Toggle {colorMode === 'light' ? 'Dark' : 'Light'}
11-
</button>
11+
</Button>
1212
</header>
1313
)
1414
}
15+
16+
export default Header

examples/next/next.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
const withMDX = require('@next/mdx')()
2-
module.exports = withMDX({
3-
pageExtensions: ['js', 'mdx'],
4-
})
2+
module.exports = withMDX({ pageExtensions: ['js', 'mdx'] })

examples/next/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
"start": "next start"
1212
},
1313
"dependencies": {
14-
"@emotion/core": "^10.0.15",
15-
"@mdx-js/loader": "^1.0.19",
16-
"@next/mdx": "^9.0.3",
17-
"next": "^9.0.2",
18-
"react": "^16.8.6",
19-
"react-dom": "^16.8.6",
14+
"@mdx-js/loader": "^1.5.8",
15+
"@next/mdx": "^9.3.4",
16+
"next": "^9.3.4",
17+
"react": "^16.13.1",
18+
"react-dom": "^16.13.1",
2019
"theme-ui": "^0.4.0-alpha.0"
2120
}
2221
}

examples/next/pages/_app.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,18 @@
11
import React from 'react'
2-
import App from 'next/app'
3-
import { ThemeProvider, Styled, ColorMode } from 'theme-ui'
2+
import NextApp from 'next/app'
43

54
import Header from '../components/Header'
65
import theme from '../src/theme'
6+
import { ThemeProvider } from 'theme-ui'
77

8-
class MyApp extends App {
9-
// Only uncomment this method if you have blocking data requirements for
10-
// every single page in your application. This disables the ability to
11-
// perform automatic static optimization, causing every page in your app to
12-
// be server-side rendered.
13-
//
14-
// static async getInitialProps(appContext) {
15-
// // calls page's `getInitialProps` and fills `appProps.pageProps`
16-
// const appProps = await App.getInitialProps(appContext);
17-
//
18-
// return { ...appProps }
19-
// }
20-
8+
export default class App extends NextApp {
219
render() {
2210
const { Component, pageProps } = this.props
2311
return (
2412
<ThemeProvider theme={theme}>
25-
<ColorMode />
2613
<Header />
27-
<Styled.root>
28-
<Component {...pageProps} />
29-
</Styled.root>
14+
<Component {...pageProps} />
3015
</ThemeProvider>
3116
)
3217
}
3318
}
34-
35-
export default MyApp

examples/next/pages/_document.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import React from 'react'
21
import Document, { Html, Head, Main, NextScript } from 'next/document'
32
import { InitializeColorMode } from 'theme-ui'
43

5-
class MyDocument extends Document {
4+
export default class extends Document {
65
static async getInitialProps(ctx) {
76
const initialProps = await Document.getInitialProps(ctx)
87
return { ...initialProps }
@@ -21,5 +20,3 @@ class MyDocument extends Document {
2120
)
2221
}
2322
}
24-
25-
export default MyDocument

examples/next/pages/hello.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @jsx jsx */
22
import { jsx, Styled } from 'theme-ui'
33

4-
export default props => (
4+
export default () => (
55
<div
66
sx={{
77
maxWidth: 1024,

examples/next/src/theme.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export default {
2-
useCustomProperties: true,
2+
initialColorModeName: 'light',
3+
useColorSchemeMediaQuery: true,
34
colors: {
45
text: '#000',
56
background: '#fff',

0 commit comments

Comments
 (0)