Skip to content

Instantly share code, notes, and snippets.

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 jurassix/be23a059814d500ff7ca to your computer and use it in GitHub Desktop.
Save jurassix/be23a059814d500ff7ca to your computer and use it in GitHub Desktop.
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
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment