Skip to content

Instantly share code, notes, and snippets.

@tkh44
Last active September 16, 2017 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkh44/ec0de0d028edc222d10e9042542c3980 to your computer and use it in GitHub Desktop.
Save tkh44/ec0de0d028edc222d10e9042542c3980 to your computer and use it in GitHub Desktop.
Brainstorming some high performance alternatives to using styled with emotion. Bonus glamor version.
import { css } from 'emotion'
class Profile extends Component {
css = (p) => css`
color: blue;
height: ${p.parentHeight};
`
render() {
return (<div className={this.css(props)}/>)
}
}
import css from 'glamor'
class Profile extends Component {
css = (p) => css({
color: 'blue',
height: p.parentHeight
})
render() {
return (<div className={this.css(props)}/>)
}
}
import { css } from 'emotion'
class Profile extends Component {
render() {
return (<div className={this.css(props)}/>)
}
}
Profile.css = (p) => css`
color: blue;
height: ${p.parentHeight};
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment