-
{title}.
+ return
+
+
{statusCode}
+
+
{title}.
}
}
-const styles = StyleSheet.create({
- error: {
+const styles = {
+ error: style({
color: '#000',
background: '#fff',
top: 0,
@@ -34,17 +34,17 @@ const styles = StyleSheet.create({
fontFamily: '"SF UI Text", "Helvetica Neue", "Lucida Grande"',
textAlign: 'center',
paddingTop: '20%'
- },
+ }),
- desc: {
+ desc: style({
display: 'inline-block',
textAlign: 'left',
lineHeight: '49px',
height: '49px',
verticalAlign: 'middle'
- },
+ }),
- h1: {
+ h1: style({
display: 'inline-block',
borderRight: '1px solid rgba(0, 0, 0,.3)',
margin: 0,
@@ -53,12 +53,12 @@ const styles = StyleSheet.create({
fontSize: '24px',
fontWeight: 500,
verticalAlign: 'top'
- },
+ }),
- h2: {
+ h2: style({
fontSize: '14px',
fontWeight: 'normal',
margin: 0,
padding: 0
- }
-})
+ })
+}
diff --git a/server/render.js b/server/render.js
index ae9dd25f..48ec57ee 100644
--- a/server/render.js
+++ b/server/render.js
@@ -8,7 +8,7 @@ import Router from '../lib/router'
import Document from '../lib/document'
import Head from '../lib/head'
import App from '../lib/app'
-import { StyleSheetServer } from '../lib/css'
+import { renderStatic } from 'glamor/server'
export async function render (url, ctx = {}, {
dir = process.cwd(),
@@ -22,7 +22,7 @@ export async function render (url, ctx = {}, {
const props = await (Component.getInitialProps ? Component.getInitialProps(ctx) : {})
const component = await read(join(dir, '.next', 'bundles', 'pages', path))
- const { html, css } = StyleSheetServer.renderStatic(() => {
+ const { html, css, ids } = renderStatic(() => {
const app = createElement(App, {
Component,
props,
@@ -41,7 +41,7 @@ export async function render (url, ctx = {}, {
data: {
component,
props,
- classNames: css.renderedClassNames,
+ ids: ids,
err: ctx.err ? errorToJSON(ctx.err) : null
},
hotReload: false,
diff --git a/test/fixtures/basic/pages/css.js b/test/fixtures/basic/pages/css.js
index c5b19c0a..9e101899 100644
--- a/test/fixtures/basic/pages/css.js
+++ b/test/fixtures/basic/pages/css.js
@@ -1,8 +1,6 @@
import React from 'react'
-import { StyleSheet, css } from 'next/css'
+import { style } from 'next/css'
-export default () =>
This is red
+export default () =>
This is red
-const styles = StyleSheet.create({
- red: { color: 'red' }
-})
+const styles = style({ color: 'red' })
diff --git a/test/index.js b/test/index.js
index 5b9fb8c0..8a396305 100644
--- a/test/index.js
+++ b/test/index.js
@@ -14,8 +14,8 @@ test(async t => {
test(async t => {
const html = await render('/css')
- t.true(html.includes(''))
- t.true(html.includes('
This is red
'))
+ t.true(html.includes('.css-im3wl1'))
+ t.true(html.includes('
This is red
'))
})
test(async t => {