forked from styled-components/styled-components
-
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.
Merge pull request styled-components#809 from styled-components/v2
Merge v2 back into master
- Loading branch information
Showing
73 changed files
with
5,081 additions
and
2,353 deletions.
There are no files selected for viewing
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,6 +1,6 @@ | ||
{ | ||
"presets": [ | ||
"env", | ||
["env", { "loose": true }], | ||
"react" | ||
], | ||
"plugins": [ | ||
|
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"rootDir": ".", | ||
"globals": { | ||
"__DEV__": true | ||
}, | ||
"testRegex": "./src/native/test/.*.js$", | ||
"preset": "react-native", | ||
"testEnvironment": "jsdom" | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react' | ||
import styled, { injectGlobal, keyframes } from '../dist/styled-components' | ||
|
||
export default () => { | ||
injectGlobal` | ||
body { | ||
font-family: sans-serif; | ||
} | ||
` | ||
|
||
// Create a <Title> react component that renders an <h1> which is | ||
// centered, palevioletred and sized at 1.5em | ||
const Title = styled.h1` | ||
font-size: 1.5em; | ||
text-align: center; | ||
color: palevioletred; | ||
animation: ${keyframes`from { opacity: 0; }`} 1s both; | ||
`; | ||
|
||
// Create a <Wrapper> react component that renders a <section> with | ||
// some padding and a papayawhip background | ||
const Wrapper = styled.section` | ||
padding: 4em; | ||
background: papayawhip; | ||
`; | ||
|
||
return class Example extends React.Component { | ||
render() { | ||
return ( | ||
<Wrapper> | ||
<Title>Hello World, this is my first styled component!</Title> | ||
</Wrapper> | ||
) | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -3,29 +3,39 @@ | |
<head> | ||
<meta charset="utf-8"> | ||
<title>Basic Example</title> | ||
<!-- SSR:CSS --> | ||
</head> | ||
<body> | ||
<h1>Basic Example</h1> | ||
<div id="container"></div> | ||
<div id="container"><!-- SSR:HTML --></div> | ||
<script src="https://unpkg.com/[email protected]/dist/react.min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/react-dom.min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/react-dom-server.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.min.js"></script> | ||
<script src="/styled-components.js"></script> | ||
<script type="text/babel"> | ||
// Create a <Title> react component that renders an <h1> which is | ||
// centered, palevioletred and sized at 1.5em | ||
const Title = styled.default.h1` | ||
font-size: 1.5em; | ||
text-align: center; | ||
color: palevioletred; | ||
`; | ||
styled.injectGlobal` | ||
body { | ||
font-family: sans-serif; | ||
} | ||
` | ||
|
||
// Create a <Title> react component that renders an <h1> which is | ||
// centered, palevioletred and sized at 1.5em | ||
const Title = styled.default.h1` | ||
font-size: 1.5em; | ||
text-align: center; | ||
color: palevioletred; | ||
animation: ${styled.keyframes`from { opacity: 0; }`} 1s both; | ||
`; | ||
|
||
// Create a <Wrapper> react component that renders a <section> with | ||
// some padding and a papayawhip background | ||
const Wrapper = styled.default.section` | ||
padding: 4em; | ||
background: papayawhip; | ||
`; | ||
|
||
// Create a <Wrapper> react component that renders a <section> with | ||
// some padding and a papayawhip background | ||
const Wrapper = styled.default.section` | ||
padding: 4em; | ||
background: papayawhip; | ||
`; | ||
class Example extends React.Component { | ||
render() { | ||
return ( | ||
|
Oops, something went wrong.