Created
November 30, 2016 15:03
-
-
Save pedronauck/dde9615bcf20816aaba274ddd5266642 to your computer and use it in GitHub Desktop.
Propose to create a inline css parser to React Components
This file contains hidden or 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
import { css } from 'css-tm'; | |
const yellow = '#FC0'; | |
const button = css` | |
background: ${yellow}; | |
`; | |
const title = (size) => css` | |
font-size: ${size}px; | |
`; | |
const Component = () => ( | |
<div> | |
<button style={button} type="button">Click</button> | |
<h2 style={title(22)}>Something</h2> | |
</div> | |
); | |
export default Component; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment