Last active
February 22, 2018 22:24
-
-
Save martinwheeler/3d9c238c0e1db0567055d7aee94b0875 to your computer and use it in GitHub Desktop.
This file contains 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 React, { PureComponent } from "react"; | |
import { render } from "react-dom"; | |
import { css } from "glamor"; | |
const flex = { | |
display: "flex" | |
}; | |
const column = { | |
flexDirection: "column" | |
}; | |
const justify = where => ({ | |
justifyContent: where | |
}); | |
const padding = px => ({ | |
padding: px | |
}); | |
const mt = px => ({ | |
marginTop: px | |
}); | |
const mb = px => ({ | |
marginBottom: px | |
}); | |
const container = css({ | |
...flex, | |
...column, | |
...padding("50px"), | |
...justify("center"), | |
...mt("10px"), | |
...mb("25px") | |
}); | |
class MyComponent extends PureComponent { | |
render() { | |
return ( | |
<div {...css(container)}> | |
<div>I'm a super flexible div</div> | |
<div>using glamor.</div> | |
</div> | |
); | |
} | |
} | |
render(<MyComponent />, document.getElementById("root")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment