Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
6535b564
Commit
6535b564
authored
Jul 08, 2017
by
Sergio Xalambrí
Committed by
Tim Neutkens
Jul 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Example Rebass (#2490)
parent
6715da98
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
122 additions
and
0 deletions
+122
-0
.babelrc
examples/with-rebass/.babelrc
+8
-0
README.md
examples/with-rebass/README.md
+32
-0
package.json
examples/with-rebass/package.json
+15
-0
_document.js
examples/with-rebass/pages/_document.js
+25
-0
index.js
examples/with-rebass/pages/index.js
+42
-0
No files found.
examples/with-rebass/.babelrc
0 → 100644
View file @
6535b564
{
"presets": [
"next/babel"
],
"plugins": [
["styled-components", { "ssr": true, "displayName": true, "preprocess": false } ]
]
}
\ No newline at end of file
examples/with-rebass/README.md
0 → 100644
View file @
6535b564
[

](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-rebass)
# Example app with Rebass

## How to use
Download the example
[
or clone the repo
](
https://github.com/zeit/next.js
)
:
```
bash
curl https://codeload.github.com/zeit/next.js/tar.gz/master |
tar
-xz
--strip
=
2 next.js-master/examples/with-rebass
cd
with-rebass
```
Install it and run:
```
bash
npm
install
ln
-f
-s
../node_modules/react-md/dist/react-md.light_blue-yellow.min.css static/react-md.light_blue-yellow.min.css
npm run dev
```
Deploy it to the cloud with
[
now
](
https://zeit.co/now
)
(
[download](https://zeit.co/download
)
)
```
bash
now
```
## The idea behind the example
This example features how you use
[
Rebass
](
http://jxnblk.com/rebass/
)
functional UI library with Next.js.
examples/with-rebass/package.json
0 → 100644
View file @
6535b564
{
"scripts"
:
{
"dev"
:
"next"
,
"build"
:
"next build"
,
"start"
:
"next start"
},
"dependencies"
:
{
"babel-plugin-styled-components"
:
"^1.1.7"
,
"next"
:
"^3.0.1-beta.8"
,
"react"
:
"^15.6.1"
,
"react-dom"
:
"^15.6.1"
,
"rebass"
:
"1.0.0-1"
,
"styled-components"
:
"^2.1.1"
}
}
examples/with-rebass/pages/_document.js
0 → 100644
View file @
6535b564
import
Document
,
{
Head
,
Main
,
NextScript
}
from
'next/document'
import
{
ServerStyleSheet
}
from
'styled-components'
export
default
class
MyDocument
extends
Document
{
render
()
{
const
sheet
=
new
ServerStyleSheet
()
const
main
=
sheet
.
collectStyles
(
<
Main
/>
)
const
styleTags
=
sheet
.
getStyleElement
()
return
(
<
html
>
<
Head
>
<
title
>
My
page
<
/title
>
{
styleTags
}
<
/Head
>
<
body
>
<
div
className
=
'root'
>
{
main
}
<
/div
>
<
NextScript
/>
<
/body
>
<
/html
>
)
}
}
examples/with-rebass/pages/index.js
0 → 100644
View file @
6535b564
import
{
Provider
,
Container
,
Heading
,
Blockquote
,
Toolbar
,
NavLink
,
Flex
,
Box
}
from
'rebass'
function
HomePage
()
{
return
(
<
Provider
>
<
Heading
is
=
'h1'
children
=
'Next.js + Rebass'
mb
=
{
3
}
center
/>
<
Container
>
<
Toolbar
bg
=
'black'
>
<
NavLink
href
=
'https://github.com/zeit/next.js/'
target
=
'_blank'
>
Next
.
js
<
/NavLink
>
<
NavLink
ml
=
'auto'
href
=
'http://jxnblk.com/rebass/'
target
=
'_blank'
>
REBASS
<
/NavLink
>
<
/Toolbar
>
<
Flex
justify
=
'center'
>
<
Box
width
=
{
1
/
2
}
>
<
Blockquote
center
fontSize
=
{
3
}
py
=
{
4
}
>
"Next.js is a minimalistic framework for server-rendered React applications."
<
/Blockquote
>
<
/Box
>
<
Box
width
=
{
6
/
12
}
>
<
Blockquote
center
fontSize
=
{
3
}
py
=
{
4
}
>
"Functional React UI component library, built with styled-components"
<
/Blockquote
>
<
/Box
>
<
/Flex
>
<
/Container
>
<
/Provider
>
)
}
export
default
HomePage
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment