visavi/rotor

View on GitHub
public/themes/default/src/sass/_header.scss

Summary

Maintainability
Test Coverage
/*----- Component: Top Navigation Bar ----- */

.app-header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 50px;
  max-width: inherit;
  display: flex;
  background-color: $navbar-color;
  z-index: 1030;
  padding-right: 10px;
  @media print { display: none; }
}

.app-header__logo {
  flex: 1 1 auto;
  color: #fff;
  text-align: center;
  padding: 0 15px;
  font-size: 26px;
  font-weight: 400;
  line-height: 50px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  @media(min-width: 768px) {
    flex: 0 0 auto;
    display: block;
    width: $sidebar-width;
    @if $sidebar-accent == dark {
      background-color: darken( $navbar-color, 5% );
    }
    @if $sidebar-accent == light {
      background-color: lighten( $navbar-color, 5% );
    }
  }
  @media(max-width: 320px) {
    display: none;
  }
  &:focus,
  &:hover {
    text-decoration: none;
    color: #fff;
  }
}

.app-icon {
  padding: 0 15px;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #fff;
  line-height: 2.4;
  transition: background-color 0.3s ease;
  @media(min-width: 768px) { display: none; }
  &:focus,
  &:hover {
    color: #fff;
    background-color: darken($navbar-color, 10);
    text-decoration: none;
  }
}

.icon-toggle {
  &:before {
    content: "\f0c9";
    font-size: 21px;
  }
  @media(max-width: 767px) { order: -1; }
}


.icon-login {
  &:before {
    content: "\f2f6";
    font-size: 21px;
  }
  @media(max-width: 767px) { order: 1; }
}

.app-nav {
  @extend .list-unstyled;
  display: flex;
  margin-bottom: 0;
  margin-left: auto;
  justify-content: flex-end;
  @media(min-width: 768px) { flex: 1 0 auto; }
}

.app-nav__item {
  display: block;
  padding: 15px;
  line-height: 20px;
  color: #fff;
  transition: background-color 0.3s ease;
  text-decoration: none !important;
  white-space: nowrap;
  &:hover,
  &:focus {
    background: rgba(0, 0, 0, 0.1);
    color: #f6f6f6;
  }
  @media(max-width: 767px) { padding: 15px 10px; }
}

.app-search {
  position: relative;
  display: flex;
  align-self: center;
  padding: 10px 0;
}

.search-navbar {
  margin-right: 15px;

  @media(max-width: 768px) {
    display: none;
  }
}

.search-sidebar {
  @media(min-width: 768px) {
    display: none;
  }
}

.app-search__input {
  border: 0;
  padding: 5px 30px 5px 10px;
  border-radius: 2px;
  background-color: rgba(255,255,255,0.8);
  transition: background-color 0.3s ease;
  &::placeholder { color: rgba(0,0,0,0.4); }
}
.app-search__button {
  position: absolute;
  right: 0;
  top: 10px;
  bottom: 10px;
  padding: 0 10px;
  border: 0;
  color: rgba(0,0,0,0.8);
  background: none;
  cursor: pointer;
}

.app-search__input:invalid + button {
  opacity: 0.5;
  pointer-events: none;
}

.app-notification {
  min-width: 270px;
  &.dropdown-menu {
    margin-top: -2px !important;
  }
}
.app-notification__title {
  padding: 8px 20px;
  text-align: center;
  background-color: transparentize($navbar-color, 0.6);
}
.app-notification__footer {
  padding: 8px 20px;
  text-align: center;
  background-color: var(--bs-body-bg);
}
.app-notification__content {
  max-height: 220px;
  overflow-y: auto;
  &::-webkit-scrollbar { width: 6px; }
  &::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); }
}
.app-notification__item {
  display: flex;
  padding: 8px 10px;
  color: inherit;
  border-bottom: 1px solid var(--bs-border-color);
  transition: background-color 0.3s ease;
  &:focus,
  &:hover {
    color: inherit;
    text-decoration: none;
    background-color: var(--base-bg);
  }
}

.app-notification__author,
.app-notification__meta {
  margin-bottom: 0;
}

.app-notification__icon {
  padding-right: 10px;
}

.app-notification__cnt {
  padding: 5px;
  margin-left: auto;
}

.app-notification__author { line-height: 1.2; }
.app-notification__meta { @extend .text-muted; @extend .small; }