Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
React Inline Styles with responsive design
<html>
<body>
<div id="app"></div>
</body>
</html>
var style = {
container: {
display: 'flex',
flexFlow: 'column wrap'
},
navigation: {
flex: '1',
background: 'aqua'
},
div: {
flex: 1,
background: 'red',
display: 'flex',
flexFlow: 'row wrap-reverse'
},
main: {
flex: '3 1 auto',
minWidth: '66vw',
background: 'green'
},
aside: {
flex: '1 1 auto',
minWidth: '33vw',
background: 'orange'
},
asideContent: {
minWidth: '200px'
}
}
var Demo = React.createClass({
displayName: 'Demo',
render: function () {
return React.createElement("div", {style: style.container},
React.createElement("nav", {style: style.navigation}, "NAV"),
React.createElement("div", {style: style.div},
React.createElement("aside", {style: style.aside},
React.createElement("div", {style: style.asideContent}, "SIDEBAR")),
React.createElement("div", {style: style.main}, "MAIN")
)
);
}
});
var el = document.getElementById('app');
React.render(Demo(), el);
@jurassix

This comment has been minimized.

Copy link
Owner Author

@jurassix jurassix commented Mar 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.