Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Te Fiti #154

Merged
merged 68 commits into from
Jul 25, 2017
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
143c4a4
Initial working version of using glamor core instead of cxs
Jul 12, 2017
f6b1798
Bump bundle size
Jul 12, 2017
8a509b9
Merge branch 'master' into glamor
Jul 12, 2017
a03ea53
Merge branch 'master' of https://github.com/tkh44/emotion into glamor
Jul 13, 2017
2c00641
Correctly merge styles.
Jul 13, 2017
94eaaaa
Merge remote-tracking branch 'origin/glamor' into glamor
Jul 13, 2017
4c37c76
Merge branch 'master' into glamor
Jul 13, 2017
833f82d
Update snapshots and add test for composition with objects
Jul 13, 2017
6a494f8
initial work
Jul 14, 2017
83a3bd9
getting it how i want it
Jul 15, 2017
ddb7916
Merge branch 'master' of https://github.com/tkh44/emotion into glamor…
Jul 15, 2017
18c46e6
Progress
Jul 16, 2017
dbee53c
Merge branch 'master' of https://github.com/tkh44/emotion into glamor…
Jul 16, 2017
c819e19
Merge branch 'master' of https://github.com/tkh44/emotion into glamor…
Jul 16, 2017
9391ed2
Merge branch 'master' of https://github.com/tkh44/emotion into glamor…
Jul 16, 2017
d332fe7
Fix flow types
Jul 16, 2017
be90c45
pass the obj styles back to babel.js
Jul 16, 2017
2bbafa8
Stuff
emmatown Jul 17, 2017
4bd77d9
Merge branch 'master' into glamor-extended
emmatown Jul 17, 2017
5e2296d
Deleting more code. Its broken state but its progress
Jul 17, 2017
fc4632c
Merge branch 'glamor-extended' of https://github.com/tkh44/emotion in…
Jul 17, 2017
6439272
broke broke broke
Jul 17, 2017
8e535fd
Formatting
Jul 17, 2017
0ad13c8
Use postcss-js objectify and change dynamic value parsing
emmatown Jul 17, 2017
68ad756
I broke css but styled is great now
emmatown Jul 17, 2017
e32b77c
ITS WORKING
Jul 17, 2017
e52a61a
more progress
Jul 17, 2017
2cd0f5c
working setup
Jul 18, 2017
b92058b
Major progress getting composing working
Jul 18, 2017
7436946
Update snapshots
Jul 18, 2017
708ccb9
Work on composing
Jul 18, 2017
f3ade2c
composes is working with props & component
Jul 18, 2017
6735c1f
Merge branches 'glamor-extended' and 'master' of https://github.com/t…
Jul 19, 2017
f85d322
copy over reduce
Jul 19, 2017
c247420
font face working. Not sure how to do do injectGlobal though.
Jul 19, 2017
c18043a
- injectGlobal ✅
Jul 19, 2017
d73affe
🎉 All tests passing
Jul 20, 2017
3e509a6
Merge branch 'master' into glamor-extended
emmatown Jul 20, 2017
6882afa
Little fixes, removing unused vars and other small stuff
emmatown Jul 20, 2017
03de7b7
Remove unused import and fn
emmatown Jul 20, 2017
e961314
Make the code more clear by moving parseCSS into babel.js
Jul 21, 2017
75ad839
- Remove code that added `.` to component selectors
Jul 21, 2017
e860520
Fix example site demos
Jul 21, 2017
7886bbe
Add test for dynamic properties of styled
Jul 21, 2017
cd4a25a
add failing snapshots
Jul 21, 2017
d44c6ba
Remove shorthandPropertyExpansions
emmatown Jul 21, 2017
1bb13e3
wtf is this bug
Jul 22, 2017
f3db5eb
fixed - bad parsing for values like `50%`
Jul 22, 2017
08ce19b
Formatting, remove unused stuff, remove useless regex escapes and fix…
emmatown Jul 23, 2017
f391862
Add tests for ::placeholder
emmatown Jul 23, 2017
975a383
Add rollup-plugin-replace
emmatown Jul 23, 2017
b063ff6
Remove stuff for ::placeholder
emmatown Jul 23, 2017
3f6ef03
Use jest-glamor-react instead of custom jest-utils
emmatown Jul 24, 2017
49b01f1
Working on example
Jul 24, 2017
f0094f8
Add grid properties to unitless list
Jul 24, 2017
ad08e03
Add `fromAST` to ASTObject so that we can extract static objs. We can…
Jul 24, 2017
762207b
Add pure comments before calls to css, keyframes and styled
emmatown Jul 24, 2017
1846d4b
Fix ASTObject.fromAST
emmatown Jul 24, 2017
2e259ae
It works for css calls
emmatown Jul 24, 2017
1982133
Prettier and expand try
emmatown Jul 24, 2017
50b59c2
Fix path removing and add pure comment to styled calls
emmatown Jul 24, 2017
1568141
Remove prefixAst
emmatown Jul 24, 2017
a98de81
Prefix object styles in the macro
emmatown Jul 24, 2017
1e88e34
Add tests for calling css without any args
emmatown Jul 24, 2017
af32351
Tests
emmatown Jul 24, 2017
e8b612c
More tests
emmatown Jul 24, 2017
1baa927
Prettier and add more tests
emmatown Jul 25, 2017
1b7036a
Add tests for dynamic keys
Jul 25, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"react"
],
"plugins": [
'emotion/babel'
['emotion/babel']
]
}
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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, is the & required now or is it just stylistic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is required now because it's how glamor knows to expand the class name

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
)
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
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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come these don't lead with a &?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cause bug

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
52 changes: 26 additions & 26 deletions example/src/playground/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,105 +11,105 @@ import styled from 'emotion/react'
import colors from 'open-color'

const dracula = css`
.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters {
& .cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters {
background-color: #282a36 !important;
color: #f8f8f2 !important;
border: none;
}

.cm-s-dracula .CodeMirror-gutters {
& .cm-s-dracula .CodeMirror-gutters {
color: #282a36;
}

.cm-s-dracula .CodeMirror-cursor {
& .cm-s-dracula .CodeMirror-cursor {
border-left: solid thin #f8f8f2 !important;
}

.cm-s-dracula .CodeMirror-linenumber {
& .cm-s-dracula .CodeMirror-linenumber {
color: #6D8A88;
}

.cm-s-dracula .CodeMirror-selected {
& .cm-s-dracula .CodeMirror-selected {
background: rgba(255, 255, 255, 0.10);
}

.cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection {
& .cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection {
background: rgba(255, 255, 255, 0.10);
}

.cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection {
& .cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection {
background: rgba(255, 255, 255, 0.10);
}

.cm-s-dracula span.cm-comment {
& .cm-s-dracula span.cm-comment {
color: #6272a4;
}

.cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 {
& .cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 {
color: #f1fa8c;
}

.cm-s-dracula span.cm-number {
& .cm-s-dracula span.cm-number {
color: #bd93f9;
}

.cm-s-dracula span.cm-variable {
& .cm-s-dracula span.cm-variable {
color: #50fa7b;
}

.cm-s-dracula span.cm-variable-2 {
& .cm-s-dracula span.cm-variable-2 {
color: white;
}

.cm-s-dracula span.cm-def {
& .cm-s-dracula span.cm-def {
color: #50fa7b;
}

.cm-s-dracula span.cm-operator {
& .cm-s-dracula span.cm-operator {
color: #ff79c6;
}

.cm-s-dracula span.cm-keyword {
& .cm-s-dracula span.cm-keyword {
color: #ff79c6;
}

.cm-s-dracula span.cm-atom {
& .cm-s-dracula span.cm-atom {
color: #bd93f9;
}

.cm-s-dracula span.cm-meta {
& .cm-s-dracula span.cm-meta {
color: #f8f8f2;
}

.cm-s-dracula span.cm-tag {
& .cm-s-dracula span.cm-tag {
color: #ff79c6;
}

.cm-s-dracula span.cm-attribute {
& .cm-s-dracula span.cm-attribute {
color: #50fa7b;
}

.cm-s-dracula span.cm-qualifier {
& .cm-s-dracula span.cm-qualifier {
color: #50fa7b;
}

.cm-s-dracula span.cm-property {
& .cm-s-dracula span.cm-property {
color: #66d9ef;
}

.cm-s-dracula span.cm-builtin {
& .cm-s-dracula span.cm-builtin {
color: #50fa7b;
}

.cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type {
& .cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type {
color: #ffb86c;
}

.cm-s-dracula .CodeMirror-activeline-background {
& .cm-s-dracula .CodeMirror-activeline-background {
background: rgba(255, 255, 255, 0.1);
}

.cm-s-dracula .CodeMirror-matchingbracket {
& .cm-s-dracula .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}
Expand All @@ -128,7 +128,7 @@ const PlaygroundContent = styled('div')`
border-radius: 4px;
}

.CodeMirror {
& .CodeMirror {
height: auto;
border-radius: 4px;
}
Expand Down
4 changes: 1 addition & 3 deletions example/src/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import PropTypes from 'prop-types'
import { registerPlugin, transform } from 'babel-standalone'
import styled from 'emotion/react'

const ric =
window.requestIdleCallback ||
window.requestAnimationFrame
const ric = window.requestIdleCallback || window.requestAnimationFrame

registerPlugin('emotion/babel', require('emotion/babel'))

Expand Down
Loading