2017-01-02 06:35:14 +00:00
|
|
|
import Document, { Head, Main, NextScript } from 'next/document'
|
2017-05-06 18:37:47 +00:00
|
|
|
import cxs from 'cxs/lite'
|
2017-01-02 06:35:14 +00:00
|
|
|
|
|
|
|
export default class MyDocument extends Document {
|
|
|
|
static async getInitialProps ({ renderPage }) {
|
|
|
|
const page = renderPage()
|
2017-02-27 23:45:49 +00:00
|
|
|
const style = cxs.getCss()
|
2017-01-02 06:35:14 +00:00
|
|
|
return { ...page, style }
|
|
|
|
}
|
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
<html>
|
|
|
|
<Head>
|
2018-12-17 16:34:32 +00:00
|
|
|
<style
|
|
|
|
id='cxs-style'
|
|
|
|
dangerouslySetInnerHTML={{ __html: this.props.style }}
|
|
|
|
/>
|
2017-01-02 06:35:14 +00:00
|
|
|
</Head>
|
|
|
|
<body>
|
|
|
|
<Main />
|
|
|
|
<NextScript />
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|