Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I hide drawer on large screens and show just on small screens.?

Even though I add "mdl-layout--small-screen-only" class on the drawer, the hamburger image still appears on large screens.

<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
  <header class="mdl-layout__header">
    <div class="mdl-layout__header-row">
      <!-- Title -->
      <span class="mdl-layout-title">Title</span>
      <!-- Add spacer, to align navigation to the right -->
      <div class="mdl-layout-spacer"></div>
      <!-- Navigation. We hide it in small screens. -->
      <nav class="mdl-navigation mdl-layout--large-screen-only">
        <a class="mdl-navigation__link" href="">Link</a>
        <a class="mdl-navigation__link" href="">Link</a>
        <a class="mdl-navigation__link" href="">Link</a>
        <a class="mdl-navigation__link" href="">Link</a>
        <a class="mdl-navigation__link" href="">Link</a>
        <a class="mdl-navigation__link" href="">Link</a>
      </nav>
    </div>
  </header>
  <div class="mdl-layout__drawer mdl-layout--small-screen-only">
    <span class="mdl-layout-title">Title</span>
    <nav class="mdl-navigation">
      <a class="mdl-navigation__link" href="">Link</a>
      <a class="mdl-navigation__link" href="">Link</a>
      <a class="mdl-navigation__link" href="">Link</a>
      <a class="mdl-navigation__link" href="">Link</a>
    </nav>
  </div>
  <main class="mdl-layout__content">
    <div class="page-content"><!-- Your content goes here --></div>
  </main>
</div>

All I need is hiding drawer including the icon on navbar while on large screens. Thanks

like image 310
Kiba Avatar asked Jul 18 '15 21:07

Kiba


1 Answers

mdl-layout--no-desktop-drawer-button

Does not display a drawer button in desktop mode

Optional; goes on mdl-layout element

GitHub

like image 179
fastec Avatar answered Feb 02 '23 01:02

fastec