Flexbox Sidebar
Create a sidebar layout with flexbox that automatically stacks when the container is narrow.
<divsx={{display: 'flex',flexWrap: 'wrap',}}><asidesx={{flexGrow: 1,flexBasis: 'sidebar',}}>Sidebar</aside><mainsx={{flexGrow: 99999,flexBasis: 0,minWidth: 320,}}>Main</main></div>
// example themeexport default {sizes: {sidebar: 256,},}
Edit the page on GitHub/** @jsxImportSource theme-ui */export default (props) => (<divsx={{display: 'flex',flexWrap: 'wrap',}}><asidesx={{flexGrow: 1,flexBasis: 'sidebar',}}>Sidebar</aside><mainsx={{flexGrow: 99999,flexBasis: 0,minWidth: 320,}}>{props.children}</main></div>)