forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* integrate styled-jsx * define styles of pages with styled-jsx * bump styled-jsx * bump styled-jsx * error-debug: fix style * bump styled-jsx * fix examples to use styled-jsx * bump styled-jsx
- Loading branch information
Showing
12 changed files
with
167 additions
and
181 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import React from 'react' | ||
import style from 'next/css' | ||
|
||
export default () => ( | ||
<div className={styles}> | ||
<div className='hello'> | ||
<p>Hello World</p> | ||
<style jsx>{` | ||
.hello { | ||
font: 15px Helvetica, Arial, sans-serif; | ||
background: #eee; | ||
padding: 100px; | ||
text-align: center; | ||
transition: 100ms ease-in background; | ||
} | ||
.hello:hover { | ||
background: #ccc; | ||
} | ||
`}</style> | ||
</div> | ||
) | ||
|
||
const styles = style({ | ||
font: '15px Helvetica, Arial, sans-serif', | ||
background: '#eee', | ||
padding: '100px', | ||
textAlign: 'center', | ||
transition: '100ms ease-in background', | ||
':hover': { | ||
background: '#ccc' | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import React from 'react' | ||
import style from 'next/css' | ||
|
||
export default ({ children }) => ( | ||
<p className={styles}>{children}</p> | ||
<p> | ||
{children} | ||
<style jsx>{` | ||
p { | ||
font: 13px Helvetica, Arial; | ||
margin: 10px 0; | ||
} | ||
`}</style> | ||
</p> | ||
) | ||
|
||
const styles = style({ | ||
font: '13px Helvetica, Arial', | ||
margin: '10px 0' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import React from 'react' | ||
import style from 'next/css' | ||
|
||
export default ({ title, children }) => ( | ||
<div className={mainStyle}> | ||
<h1 className={titleStyle}>{ title }</h1> | ||
<div className='main'> | ||
<h1>{ title }</h1> | ||
{ children } | ||
<style jsx>{` | ||
.main { | ||
font: 15px Helvetica, Arial; | ||
border: 1px solid #eee; | ||
padding: 0 10px; | ||
} | ||
h1 { | ||
font-size: 16px; | ||
font-weight: bold; | ||
margin: 10px 0; | ||
} | ||
`}</style> | ||
</div> | ||
) | ||
|
||
const mainStyle = style({ | ||
font: '15px Helvetica, Arial', | ||
border: '1px solid #eee', | ||
padding: '0 10px' | ||
}) | ||
|
||
const titleStyle = style({ | ||
fontSize: '16px', | ||
fontWeight: 'bold', | ||
margin: '10px 0' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,46 @@ | ||
import React from 'react' | ||
import P from '../components/paragraph' | ||
import Post from '../components/post' | ||
import style from 'next/css' | ||
|
||
export default () => ( | ||
<div className={styles.main}> | ||
<div className='main'> | ||
<Post title='My first blog post'> | ||
<P>Hello there</P> | ||
<P>This is an example of a componentized blog post</P> | ||
</Post> | ||
|
||
<Hr /> | ||
<hr /> | ||
|
||
<Post title='My second blog post'> | ||
<P>Hello there</P> | ||
<P>This is another example.</P> | ||
<P>Wa-hoo!</P> | ||
</Post> | ||
|
||
<Hr /> | ||
<hr /> | ||
|
||
<Post title='The final blog post'> | ||
<P>C'est fin</P> | ||
</Post> | ||
|
||
<style jsx>{` | ||
.main { | ||
margin: auto; | ||
max-width: 420px; | ||
padding: 10px; | ||
} | ||
hr { | ||
width: 100px; | ||
border-width: 0; | ||
margin: 20px auto; | ||
text-align: center; | ||
} | ||
hr::before { | ||
content: "***"; | ||
color: #ccc; | ||
} | ||
`}</style> | ||
</div> | ||
) | ||
|
||
const Hr = () => <hr className={styles.hr} /> | ||
|
||
const styles = { | ||
main: style({ | ||
margin: 'auto', | ||
maxWidth: '420px', | ||
padding: '10px' | ||
}), | ||
|
||
hr: style({ | ||
width: '100px', | ||
borderWidth: 0, | ||
margin: '20px auto', | ||
textAlign: 'center', | ||
'::before': { | ||
content: '"***"', | ||
color: '#ccc' | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.