File tree Expand file tree Collapse file tree 5 files changed +77
-0
lines changed
examples/with-styled-jsx-postcss Expand file tree Collapse file tree 5 files changed +77
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "presets" : [
3+ " next/babel"
4+ ],
5+ "plugins" : [
6+ " styled-jsx-postcss/babel"
7+ ]
8+ }
Original file line number Diff line number Diff line change 1+
2+ # Example app with styled-jsx-postcss
3+
4+ This example features how you use PostCSS with styled-jsx via [ styled-jsx-postcss] ( https://github.com/giuseppeg/styled-jsx-postcss )
5+
6+ ## How to use
7+
8+ Download the example (or clone the repo)[ https://github.com/zeit/next.js.git ] :
9+
10+ ``` bash
11+ curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-styled-jsx-postcss
12+ cd with-styled-jsx-postcss
13+ ```
14+
15+ Install it and run:
16+
17+ ``` bash
18+ npm install
19+ npm run dev
20+ ```
21+
22+ Deploy it to the cloud with [ now] ( https://zeit.co/now ) ([ download] ( https://zeit.co/download ) )
23+
24+ ``` bash
25+ now
26+ ```
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " with-styled-jsx-postcss" ,
3+ "version" : " 1.0.0" ,
4+ "scripts" : {
5+ "dev" : " next" ,
6+ "build" : " next build" ,
7+ "start" : " next start"
8+ },
9+ "dependencies" : {
10+ "next" : " ^2.0.0-beta" ,
11+ "postcss-cssnext" : " ^2.9.0" ,
12+ "styled-jsx-postcss" : " ^0.1.5"
13+ },
14+ "author" : " Giuseppe Gurgone" ,
15+ "license" : " MIT"
16+ }
Original file line number Diff line number Diff line change 1+ export default ( ) => (
2+ < div className = 'hello' >
3+ < p > Hello World</ p >
4+ < style jsx > { `
5+ :global(:root) {
6+ --bgColor: green;
7+ --color: white;
8+ }
9+ .hello {
10+ font: 15px Helvetica, Arial, sans-serif;
11+ background: var(--bgColor);
12+ color: var(--color);
13+ padding: 100px;
14+ text-align: center;
15+ transition: 100ms ease-in background;
16+ }
17+ .hello:hover {
18+ color: color(var(--color) blackness(+80%));
19+ }
20+ ` } </ style >
21+ </ div >
22+ )
Original file line number Diff line number Diff line change 1+ module . exports = ( ) => ( {
2+ plugins : {
3+ 'postcss-cssnext' : { }
4+ }
5+ } )
You can’t perform that action at this time.
0 commit comments