Skip to content
Snippets Groups Projects
DashboardLayout.vue 1.91 KiB
Newer Older
Lukas Jelonek's avatar
Lukas Jelonek committed
<template>
  <header
    class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow"
  >
    <slot name="header" />
  </header>
  <div class="container-fluid">
    <div class="row">
      <nav
        id="sidebarMenu"
        class="
          col-md-3 col-lg-2
          d-md-block
          bg-light
          sidebar sidebar-left
          collapse
        "
      >
        <slot name="sidebar" />
      </nav>
      <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4 mt-4">
        <slot />
      </main>
    </div>
  </div>
</template>
<script>
export default {};
</script>

<style>
.sidebar-left {
  position: fixed;
  top: 0;
  /* rtl:raw:
  right: 0;
  */
  bottom: 0;
  /* rtl:remove */
  left: 0;
  z-index: 100; /* Behind the navbar */
  padding: 48px 0 0; /* Height of navbar */
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
}

@media (max-width: 767.98px) {
  .sidebar-left {
    top: 2rem;
  }
}

.sidebar-sticky {
  position: relative;
  top: 0;
  height: calc(100vh - 48px);
  padding-top: 0.5rem;
  overflow-x: hidden;
  overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
}

.sidebar .nav-item .feather {
  margin-right: 4px;
  color: #727272;
}
.sidebar .entry {
  padding: 0.5rem 1rem;
}

.sidebar button {
  border: none;
  background-color: inherit;
}

Lukas Jelonek's avatar
Lukas Jelonek committed
.sidebar .nav-link {
  font-weight: 500;
  color: #333;
}

.sidebar .nav-link .feather {
  margin-right: 4px;
  color: #727272;
}

.sidebar .nav-link.active {
  color: #007bff;
}

.sidebar .nav-link:hover .feather,
.sidebar .nav-link.active .feather {
  color: inherit;
}

.sidebar-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
}

/*
 * Navbar
 */

.navbar-brand {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  font-size: 1rem;
  background-color: rgba(0, 0, 0, 0.25);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25);
}

.navbar .navbar-toggler {
  top: 0.25rem;
  right: 1rem;
}
</style>