Skip to content

Commit

Permalink
Merge pull request #154 from tkh44/glamor-extended
Browse files Browse the repository at this point in the history
The heart of Te Fiti
  • Loading branch information
Kye Hohenberger authored Jul 25, 2017
2 parents 719ec37 + 1b7036a commit 89cb795
Show file tree
Hide file tree
Showing 91 changed files with 3,384 additions and 3,486 deletions.
7 changes: 5 additions & 2 deletions example/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
"env",
{
"modules": false,
"loose": true
"loose": true,
"targets": {
"uglify": true
}
}
],
"stage-2",
"react"
],
"plugins": [
'emotion/babel'
['emotion/babel']
]
}
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"devDependencies": {
"babel-core": "^6.23.1",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.0.0",
"babel-preset-env": "^1.5.1",
"babel-loader": "^7.1.1",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babel-standalone": "^6.24.2",
Expand Down
2 changes: 1 addition & 1 deletion example/src/blocks/composes.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ const Avatar = styled('img')`
}
`

render(<Avatar src={avatarUrl} />, mountNode)
render(<Avatar src={logoUrl} />, mountNode)
4 changes: 2 additions & 2 deletions example/src/blocks/css-prop.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ render(
background-color: #8c81d8;
border-radius: 4px;

img {
& img {
width: 96px;
height: 96px;
border-radius: 50%;
Expand All @@ -24,7 +24,7 @@ render(
}
`}
>
<img src={avatarUrl} />
<img src={logoUrl} />
</div>,
mountNode
)
2 changes: 1 addition & 1 deletion example/src/blocks/intro.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ const Avatar = styled('img')`
border-radius: 50%;
`

render(<Avatar src={avatarUrl} />, mountNode)
render(<Avatar src={logoUrl} />, mountNode)
2 changes: 1 addition & 1 deletion example/src/blocks/keyframes.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ const Avatar = styled('img')`
`

render(
<Avatar src={avatarUrl} rounded />,
<Avatar src={logoUrl} rounded />,
mountNode
)
2 changes: 1 addition & 1 deletion example/src/blocks/media.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const Avatar = styled('img')`
`

render(
<Avatar src={avatarUrl} rounded />,
<Avatar src={logoUrl} rounded />,
mountNode
)
2 changes: 1 addition & 1 deletion example/src/blocks/named.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ const Avatar = styled('img')`
`

render(
<Avatar src={avatarUrl} />,
<Avatar src={logoUrl} />,
mountNode
)
4 changes: 2 additions & 2 deletions example/src/blocks/nested.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const Avatar = styled('div')`
img {
& img {
width: 96px;
height: 96px;
border-radius: 50%;
}
`

render(
<Avatar><img src={avatarUrl} /></Avatar>,
<Avatar><img src={logoUrl} /></Avatar>,
mountNode
)
40 changes: 22 additions & 18 deletions example/src/blocks/objects.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@ const imageStyles = css({
height: 96
})

const fakeBlue = css([
{
color: "blue"
}
]);

const red = css([
{
color: "red"
}
]);

const blue = css([
red,
{
color: "blue"
}
]);

const prettyStyles = css([
{
borderRadius: '50%',
Expand All @@ -11,29 +30,14 @@ const prettyStyles = css([
transform: 'scale(1.2)'
}
},
{ border: '3px solid #8c81d8' }
{border: '3px solid currentColor'}
])

const Avatar = styled('img')`
composes: ${prettyStyles} ${imageStyles};
composes: ${prettyStyles} ${imageStyles} ${blue}
`

const AvatarContainer = styled.div(
imageStyles,
{
borderRadius: 10,
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
},
props => ({
backgroundColor: props.backgroundColor
})
)

render(
<AvatarContainer backgroundColor='pink'>
<Avatar src={avatarUrl} />
</AvatarContainer>,
<Avatar src={logoUrl}/>,
mountNode
)
2 changes: 1 addition & 1 deletion example/src/blocks/props.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ const Avatar = styled('img')`
`

render(
<Avatar src={avatarUrl} rounded />,
<Avatar src={logoUrl} rounded />,
mountNode
)
2 changes: 1 addition & 1 deletion example/src/blocks/pseudo.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const Avatar = styled('img')`
`

render(
<Avatar src={avatarUrl} rounded />,
<Avatar src={logoUrl} rounded />,
mountNode
)
2 changes: 1 addition & 1 deletion example/src/blocks/styled-with-object.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ const Avatar = styled('img')({
borderRadius: '50%'
})

render(<Avatar src={avatarUrl} />, mountNode)
render(<Avatar src={logoUrl} />, mountNode)
2 changes: 1 addition & 1 deletion example/src/blocks/styling-any-component.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ const Avatar = styled(Image)`
border-radius: 50%;
`

render(<Avatar src={avatarUrl} />, mountNode)
render(<Avatar src={logoUrl} />, mountNode)
2 changes: 1 addition & 1 deletion example/src/blocks/theming.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Avatar = styled('img')`

render(
<ThemeProvider theme={theme}>
<Avatar src={avatarUrl} />
<Avatar src={logoUrl} />
</ThemeProvider>,
mountNode
)
27 changes: 0 additions & 27 deletions example/src/main.emotion.css

This file was deleted.

6 changes: 3 additions & 3 deletions example/src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { render } from 'react-dom'
import { ThemeProvider } from 'emotion/react/theming'
import styled, { css, fontFace, keyframes, injectGlobal } from 'emotion/react'
import styled, { css, fontFace, keyframes, injectGlobal } from 'emotion/react'
import Markdown from './markdown'
import Playground from './playground'
import logoUrl from '../../emotion.png'
Expand Down Expand Up @@ -60,7 +60,7 @@ const theme = {
const PlaygroundWrapper = styled('div')`
font-family: 'Oxygen', sans-serif;
flex:1;
color: attr(color, #343a40);
color: #343a40;
background: #f8f9fa;
& .inner {
Expand Down Expand Up @@ -224,7 +224,7 @@ class App extends React.Component {
{/* }} */}
{/* /> */}

<Markdown markdown={require('../../docs/theming.md')}/>
<Markdown markdown={require('../../docs/theming.md')} />
<Playground
maxHeight={180}
noRender={false}
Expand Down
22 changes: 0 additions & 22 deletions example/src/markdown/index.emotion.css

This file was deleted.

7 changes: 4 additions & 3 deletions example/src/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import styles from './index.css'

const MarkdownContainer = styled('div')`
composes: ${styles.markdownContainer};
h1, h2, h3, h4, h5 {
margin: 16px 0 8px 0;
letter-spacing: 1px;
Expand All @@ -19,7 +20,7 @@ const Link = styled('a')`
text-decoration: none;
color: ${p => p.theme.purple};
p & {
& p & {
margin: 0;
}
Expand All @@ -34,7 +35,7 @@ const Paragraph = styled('p')`
font-size: 0.85rem;
color: ${colors.gray[8]};
a {
& a {
font-size: 0.85rem;
}
Expand All @@ -47,7 +48,7 @@ const Code = styled('code')`
background-color: ${colors.gray[1]};
padding: 1px;
p & {
& p & {
font-size: 0.99rem;
}
`
Expand Down
Loading

0 comments on commit 89cb795

Please sign in to comment.