How do I hide the sidebar for anon viewers?

Hello,

With this you can hide the sidebar for anons. :slightly_smiling_face:

Common / CSS

html.anon {
  // Hide the narrow desktop sidebar 
  // sidebar mobile version which is activate on desktop too under 1000px width
  .d-header .hamburger-panel {
    display: none;
  }
  // Hide the header cloak when menu opens
  .header-cloak {
    display: none !important;
  }
}

Desktop / CSS

html.anon {
  // If sidebar opened use the closed style
  body.has-sidebar-page {
    #main-outlet-wrapper {
      grid-template-columns: 0 minmax(0, 1fr);
      gap: 0;
      padding-left: 10px;
    }
    .wrap {
      max-width: var(--d-max-width);
    }
  }
  // Hide hamburger button
  .header-sidebar-toggle {
    display: none;
  }
}

Mobile / CSS

html.anon {
  // Hide hamburger button
  .d-header-icons {
    .header-dropdown-toggle {
      &.hamburger-dropdown {
        display: none;
      }
    }
  }
}
10 Likes