mui icon indicating copy to clipboard operation
mui copied to clipboard

Flex layout in demos

Open konsumer opened this issue 7 years ago • 2 comments

I'd be happy to make a PR for flex-layout examples instead of table-layout for all the examples, if there is interest.

I think it would simplify layout, and also be more semantically correct (these things aren't tables.)

Here is an example for AppBar, in react, with branding & a menu, mostly pulled from the example layout:

.mui-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mui-appbar > * {
  margin: 0;
  padding: 0 10px;
}

.mui-appbar a {
  color: inherit;
}
import Appbar from 'muicss/lib/react/appbar'

export default () => (
  <Appbar>
    <h1 className='mui--text-title'>Sitename</h1>
    <ul className='mui-list--inline mui--text-body2'>
      <li><a href='#'>About</a></li>
      <li><a href='#'>Pricing</a></li>
      <li><a href='#'>Login</a></li>
    </ul>
  </Appbar>
)
screen shot 2018-11-08 at 12 00 59 pm

It might even make sense to make some little flex util-classes, but it's simple enough to do it one-off like this, in my opinion.

konsumer avatar Nov 08 '18 20:11 konsumer

Yes please! It would be very helpful if you could do that.

On Nov 8, 2018, at 11:02 PM, David Konsumer [email protected] wrote:

I'd be happy to make a PR for flex-layout examples instead of table-layout for all the examples, if there is interest.

I think it would simplify layout, and also be more semantically correct (these things aren't tables.)

Here is an example for AppBar, in react, with branding & a menu, mostly pulled from the example layout:

.mui-appbar { display: flex; align-items: center; }

.mui-appbar > * { flex: 1; margin: 0; padding: 0 10px; }

.mui-appbar a { color: inherit; } import Appbar from 'muicss/lib/react/appbar'

export default () => ( <Appbar> <h1 className='mui--text-title'>Sitename <ul className='mui-list--inline mui--text-body2 mui--text-right'>

  • About
  • Pricing
  • Login
  • </Appbar> )

    It might even make sense to make some little flex util-classes, but it's simple enough to do it one-off like this, in my opinion.

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

    amorey avatar Nov 08 '18 20:11 amorey

    I can't seem to find the source for the doc-site. Where should I make the changes?

    For reference, here is the pages that should be converted to non-table layout, in my opinion:

    I totally agree about table-layout for HTML Emails. It's a good idea and well-supported with email-client's limited CSS support.

    konsumer avatar Nov 09 '18 07:11 konsumer