Recipes / Flexbox Sidebar
Flexbox Sidebar
Create a sidebar layout with flexbox that automatically stacks when the container is narrow.
// example themeexport default {sizes: {sidebar: 256,},}
/** @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>)