Skip to content

Instantly share code, notes, and snippets.

@pedronauck
Created November 30, 2016 15:03
Show Gist options
  • Save pedronauck/dde9615bcf20816aaba274ddd5266642 to your computer and use it in GitHub Desktop.
Save pedronauck/dde9615bcf20816aaba274ddd5266642 to your computer and use it in GitHub Desktop.
Propose to create a inline css parser to React Components
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