hummingbird-me/hummingbird

View on GitHub
app/assets/stylesheets/partials/dashboard-widgets.scss

Summary

Maintainability
Test Coverage
.community-widget-panel, .trending-group-panel {
  @extend .panel;
  @extend .panel-default;
  @extend .clearfix;
  float: left;
  width: 100%;

  .panel-body {
    padding: 0;

    .latest-post-list {
      margin: 0;
      padding: 0;

      .latest-post-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 5px;

        a {
          color: #555;
          font-weight: 500;
          font-size: 14px;
        }
      }

      .latest-post {
        list-style-type: none;
        border-bottom: 1px solid #ddd;
        padding: 10px;
        height: 70px;

        .post-count-and-time {
          display: inline-block;
          padding-top: 2px;
          font-size: 0.8em;
          color: #666;
        }
      }

      .recent-post-avatar {
        width: 20px;
        height: 20px;
        border: none;
        margin-right: 5px;
      }

      .latest-post-more {
        padding: 10px;
        text-align: center;
        background: #f7f7f7;

        a {
          color: #7a7a7a;
          &:hover {
            color: $orange;
          }
        }
      }
    }
  }

  .trend-rank {
    font-weight: bold;
    border: 1px solid #D1D1D1;
    font-size: 20px;
    border-radius: 50%;
    line-height: 30px;
    display: inline-block;
    width: 35px;
    height: 35px;
    text-align: center;
    color: #7a7a80;
    position: relative;
    top: 7px;
    float: left;
    margin-right: 15px;
  }

  .trend-poster {
    width: 50px;
    height: 50px;
    float: left;
    display: inline-block;
    overflow: hidden;
    border-radius: 3px;
  }

  .trend-info {
    float: left;
    display: inline-block;
    margin-left: 10px;
    h4 {
      margin-top: 0;
      margin-bottom: 5px;
      font-weight: normal;
    }
  }

  .trend-categories {
    .badge {
      background: #838c9a;
      border-radius: 3px;
      padding: 7px 5px;
      margin-right: 2px;
      font-size: 10px;
      a {
        color: #fff;
        font-weight: normal;
        padding: 7px 5px;
        letter-spacing: 1px;
      }
    }
  }

  .loading-heading {
    padding: 18px;
  }

  .loading-wrapper {
    padding: 10px;
  }

  .loading-image {
    animation-duration: 1s;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
    animation-name: placeHolderShimmer;
    animation-timing-function: linear;
    background: #f6f7f8;
    background-image: gradient(linear, left center, right center, from(#f6f7f8), color-stop(.2, #edeef1), color-stop(.4, #f6f7f8), to(#f6f7f8));
    background-image: linear-gradient(left, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px;
    height: 49px;
    position: relative;

    div {
      background: #fff;
      height: 6px;
      left: 0;
      position: absolute;
      right: 0;

      &.l-2, &.l-3, &.l-4, &.l-5, &.l-6 {
        height: 24px;
        width: 10px;
        top: 30px;
        left: inherit;
      }

      &.l-1 {
        top: 20px;
        height: 10px;
      }

      &.l-2 {
        width: 183px;
        left: 130px;
      }

      &.l-3 { right: 20px; }
      &.l-4 { right: 50px; }
      &.l-5 { right: 80px; }
      &.l-6 { right: 110px; }
    }
  }
}

.loading-post {
  border-bottom: 1px solid #ddd;

  hr { margin: 0; }
}

@keyframes placeHolderShimmer{
  0% { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

.trending-group-panel {
  .panel-body .latest-post-list {
    margin-top: 15px;
    li {
      padding: 0 10px;
      &:last-child {
        border-top: 1px solid #ddd;
        padding-left: 0;
        padding-right: 0;
      }
    }
  }
}