kai-jacobsen/kontentblocks

View on GitHub
css/sass/partials/_frontend/_menubar-side.scss

Summary

Maintainability
Test Coverage
body.admin-bar .kb-sidebar-wrap, body.admin-bar .kb-sidebar-extension {
  top: 32px;
}

.kb-sidebar-wrap * {
  font-family: 'Open Sans', sans-serif;
  letter-spacing: normal;
  font-size: 14px !important;

  .dashicons{
    font-family: 'dashicons';
    color: #000;
  }
}

.kb-sidebar-wrap {
  height: 100vh;
  width: 340px;
  background-color: #fff;
  position: fixed;
  left: 0;
  top: 0;
  //  border-right: 1px solid #f2f2f2;
  box-shadow: 0px 1px 8px #333;
  font-family: 'Open Sans', sans-serif !important;
  z-index: 2000;
  transition: all .3s ease-out;
  opacity: 1;

  &.kb-opaque {
    opacity: .7;
  }

  #onsite-modal.kb-modal-sidebar {
    top: 29px !important;
    border-top: 0;
    border: none !important;
    overflow: hidden;
    position: absolute !important;

    .kb-nano{
      height: 100% !important;
    }

    .kb-nano-content{
      padding-bottom: 100px;
    }
  }

}

.ui-resizable-e {
  cursor: e-resize;
  width: 7px;
  right: 0px;
  top: 0;
  height: 100%;
  position: absolute;
}

.kb-sidebar__nav-controls {
  background-color: #444;

  .kb-sidebar__nav-button {
    color: #fff;
    line-height: 145%;
    padding: 4px 8px;
    cursor: pointer;
    .dashicons {
      font-size: 17px;
      vertical-align: middle;
    }
  }

}

.kb-sidebar-areaview {
  font-size: 13px;
  background-color: #f2f2f2;
  border-bottom: 1px solid #ccc;
  transition: all .4s ease-out;
  position: relative;

  &.kb-sidebar-areaview--inactive {
    font-size: 13px;
  }

  .kb-sidebar__add-module {
    position: absolute;
    right: 10px;
    top: 8px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity .3s ease-out;
    &:hover {
      opacity: 1;
    }
  }

  .kb-sidebar-areaview__title {
    padding: 10px;
    margin-left: 30px;
    position: relative;
    cursor: pointer;

    &:before {
      font-family: 'dashicons';
      content: "\f480";
      display: block;
      position: absolute;
      width: 20px;
      height: 20px;
      left: -10px;
      color: #333;
    }
  }

  div.kb-sidebar-module-list-container {
    margin: 0;
    padding: 0;
    position: relative;


    div.kb-sidebar-item__wrapper {
      border-bottom: 1px solid #ccc;
      border-top: 1px solid #fff;
      cursor: pointer;
      padding: 5px 10px 5px 20px;
      background-color: #f9f9f9;
      position: relative;
      transition: background .3s ease-in;

      &:hover {
        background-color: #f6f6f6;
      }

      &:last-child {
        border-bottom: none;
      }
    }
  }
}

.kb-sidebar-item__wrapper {

  position: relative;

  .kb-sidebar-item__name {
    font-size: 13px;
    line-height: 100%;
  }

  .kb-sidebar-item__id {
    font-size: 12px;
    color: #999;
  }

}

.kb-sidebar-item__actions {
  position: absolute;
  right: 10px;
  top: 7px;

  .kb-sidebar__module-update {
    opacity: 0.1;

    .kb-module-dirty & {
      opacity: 1;
      color: #ff4b66;
    }

  }

  .dashicons {
    font-size: 16px;
    width: 16px;
  }
}

body.onsite-editing .kb-in-sidebar-active {
  position: relative;

  &:before {
    content: '';
    position: absolute;
    background-color: $ultralightblue;
    outline: 1px solid #333;
    opacity: .5;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    height: 100%;
    width: 100%;
    margin-left: -0%;
    margin-top: -0%;
  }

  //&:hover:before {
  //  outline: none;
  //  background-color: transparent;
  //}
}

.kb-sidebar-area-details__header {
  background-color: $grey-900;
  font-size: 16px;
  color: #fff;
  font-weight: 900;
  padding: 6px 8px;
  position: relative;

  span {
    display: block;
    font-size: 12px;
    font-weight: 100;
  }
}

.kb-sidebar-action--cog {
  display: block;
  position: absolute;
  width: 20px;
  height: 20px;
  right: 5px;
  top: 5px;
  font-family: dashicons;
  color: #fff;
  font-weight: 100;
  cursor: pointer;

  & > .dashicons {
    font-size: 18px;
  }
}

.kb-sidebar-action--update {
  display: block;
  position: absolute;
  width: 20px;
  height: 20px;
  right: 30px;
  top: 5px;
  font-family: dashicons;
  color: #fff;
  font-weight: 100;
  cursor: pointer;

  & > .dashicons {
    font-size: 18px;
  }
}

.kb-sidebar-action--close {
  display: block;
  position: absolute;
  width: 20px;
  height: 20px;
  font-family: genericons;
  font-size: 12px !important;
  right: 5px;
  top: 9px;
  color: #fff;
  cursor: pointer;
}

.kb-sidebar__subheader {
  font-size: 13px;
  padding: 4px 8px;
  //background-color: darken(#3b5963, 10%);
  background-color: $grey-900;
  color: #fff;
}

.kb-sidebar-area-details__settings {

  .kb-sidebar-area-details__templates {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;

    li {
      font-size: 13px;
      border-bottom: 1px solid #ccc;
      background-color: #fcfcfc;
      padding: 5px 8px 5px 35px;
      position: relative;

      &.kb-active-area-layout {
        font-weight: bold;
        background-color: #f2f2f2;
      }

      &:hover {
        font-weight: bold;
        cursor: pointer;
      }

      &:before {
        content: "\f509";
        font-family: dashicons;
        position: absolute;
        left: 10px;
        top: 6px;
        color: #999;
      }
    }
  }
}

.kb-sidebar__item {
  padding: 10px;
  font-size: 13px !important;
  background-color: #fcfcfc;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
}

.kb-sidebar__item--root {
  .dashicons {
    position: absolute;
    right: 8px;
  }
}

/*------------------------------------*\
    Category Items / part of Area Details
\*------------------------------------*/
.kb-sidebar__category-item {

  .kb-sidebar__category-item__title {
    font-size: 12px;
    background-color: #555;
    color: #fff;
    padding: 4px 8px;
  }

  .kb-sidebar__category-item__module-list {
    list-style: none !important;
    padding: 0;
    margin: 0;

    div.kb-sidebar-module {
      font-size: 13px;
      background-color: #fcfcfc;
      border-bottom: 1px solid #ccc;
      position: relative;
      padding: 8px 8px 8px 30px;
      cursor: move;

      &:before {
        content: '\f436';
        display: block;
        position: absolute;
        left: 5px;
        top: 2px;
        color: #999;
        font-size: 25px;
        font-family: 'genericons';
      }
    }
  }
}

/*------------------------------------*\
    Drag & Drop Helper
\*------------------------------------*/
.kb-sidebar-drop-helper, .ui-draggable-dragging {
  width: 300px;
  height: 50px;
  opacity: 0.5;
  background-color: #f2f2f2;
  border: 1px dotted #333;
}

/*------------------------------------*\
    Panel Details / Overlay
\*------------------------------------*/

.kb-sidebar-extension {
  width: 450px;
  background-color: #fff;
  height: 100%;
  position: fixed;
  top: 0;
  box-shadow: 0px 1px 8px #333;
  font-family: 'Open Sans';
}

/*------------------------------------*\
    Toggle Icon
\*------------------------------------*/

.kb-sidebar-wrap--toggle {
  position: fixed;
  width: 40px;
  height: 40px;
  line-height: 40px;
  background-color: $grey-900;
  left: 10px;
  bottom: 10px;
  border-radius: 30px;
  box-shadow: 1px 1px 3px #333;
  z-index: 2999;
  text-align: center;

  &::before {
    content: '\f445';
    color: #fff;
    font-family: 'genericons' !important;
    font-size: 20px;
    font-weight: 100;
    cursor: pointer;
  }

}

/*------------------------------------*\
    FX
\*------------------------------------*/
.kb-fx-button {
  &::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -25px 0 0 -25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
  }
}

.kb-fx-button--effect-boris::after {
  background: rgba(111, 148, 182, 0.1);
}

.kb-fx-button--effect-boris.kb-fx-button--click::after {
  animation: anim-effect-boris 0.3s forwards;
}

@keyframes anim-effect-boris {
  0% {
    transform: scale3d(0.3, 0.3, 1);
  }
  25%, 50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale3d(1.2, 1.2, 1);
  }
}