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
0d6ceec8
Commit
0d6ceec8
authored
Jan 16, 2017
by
Giuseppe
Committed by
Guillermo Rauch
Jan 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add styled-jsx-postcss example (#781)
* Add styled-jsx-postcss example * Remove commented code
parent
782807bb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
0 deletions
+77
-0
.babelrc
examples/with-styled-jsx-postcss/.babelrc
+8
-0
README.md
examples/with-styled-jsx-postcss/README.md
+26
-0
package.json
examples/with-styled-jsx-postcss/package.json
+16
-0
index.js
examples/with-styled-jsx-postcss/pages/index.js
+22
-0
postcss.config.js
examples/with-styled-jsx-postcss/postcss.config.js
+5
-0
No files found.
examples/with-styled-jsx-postcss/.babelrc
0 → 100644
View file @
0d6ceec8
{
"presets": [
"next/babel"
],
"plugins": [
"styled-jsx-postcss/babel"
]
}
examples/with-styled-jsx-postcss/README.md
0 → 100644
View file @
0d6ceec8
# Example app with styled-jsx-postcss
This example features how you use PostCSS with styled-jsx via
[
styled-jsx-postcss
](
https://github.com/giuseppeg/styled-jsx-postcss
)
## How to use
Download the example (or clone the repo)
[
https://github.com/zeit/next.js.git
]
:
```
bash
curl https://codeload.github.com/zeit/next.js/tar.gz/master |
tar
-xz
--strip
=
2 next.js-master/examples/with-styled-jsx-postcss
cd
with-styled-jsx-postcss
```
Install it and run:
```
bash
npm
install
npm run dev
```
Deploy it to the cloud with
[
now
](
https://zeit.co/now
)
(
[download](https://zeit.co/download
)
)
```
bash
now
```
examples/with-styled-jsx-postcss/package.json
0 → 100644
View file @
0d6ceec8
{
"name"
:
"with-styled-jsx-postcss"
,
"version"
:
"1.0.0"
,
"scripts"
:
{
"dev"
:
"next"
,
"build"
:
"next build"
,
"start"
:
"next start"
},
"dependencies"
:
{
"next"
:
"^2.0.0-beta"
,
"postcss-cssnext"
:
"^2.9.0"
,
"styled-jsx-postcss"
:
"^0.1.5"
},
"author"
:
"Giuseppe Gurgone"
,
"license"
:
"MIT"
}
examples/with-styled-jsx-postcss/pages/index.js
0 → 100644
View file @
0d6ceec8
export
default
()
=>
(
<
div
className
=
'hello'
>
<
p
>
Hello
World
<
/p
>
<
style
jsx
>
{
`
:global(:root) {
--bgColor: green;
--color: white;
}
.hello {
font: 15px Helvetica, Arial, sans-serif;
background: var(--bgColor);
color: var(--color);
padding: 100px;
text-align: center;
transition: 100ms ease-in background;
}
.hello:hover {
color: color(var(--color) blackness(+80%));
}
`
}
<
/style
>
<
/div
>
)
examples/with-styled-jsx-postcss/postcss.config.js
0 → 100644
View file @
0d6ceec8
module
.
exports
=
()
=>
({
plugins
:
{
'postcss-cssnext'
:
{}
}
})
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