hummingbird-me/hummingbird

View on GitHub
app/assets/stylesheets/partials/chat.css.scss

Summary

Maintainability
Test Coverage
.chat-container {
  position: absolute;
  height: 100%;
  width: 100%;
  padding-top: 50px;
  top: 0;
  display: flex;
  align-content: stretch;

  .online-users {
    height: 100%;
    overflow-y: scroll;
    width: 20%;
    background: #4B5360;
    @media (max-width: 768px) {
      display: none;
    }

    ul {
      li {
        border-top: 1px solid #545C69;
        border-bottom: 1px solid #404752;

        a {
          color: #eaeaea;
          display: block;
          padding: 10px;
          &:hover {
            background: lighten(#434A56, 2);
          }
        }

        img {
          height: 25px;
          width: 25px;
          margin-right: 10px;
          border-radius: 3px;
        }

        &.header {
          text-align: center;
          padding-top: 9px;
          height: 40px;
          color: #F5B144;
        }
      }
    }
  }

  .chat-window {
    width: 80%;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 40px;
    @media (max-width: 768px) {
      width: 100%;
      padding-top: 50px;
    }

    .chat-items {
      height: 100%;
      overflow-y: scroll;
      overflow-x: hidden;
      // to bring back inertial scrolling on iOS
      -webkit-overflow-scrolling: touch;

      li {
        @extend .clearfix;
        background: #F4F4F6;
        .username, .message {
          float: left;
          line-height: 28px;
        }
        .username {
          width: 15%;
          text-align: right;
          padding: 5px 20px;
          font-weight: bold;
          font-family: "klavika", Helvetica, Arial, sans-serif;
          opacity: 0.8;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          cursor: pointer;
          .fa {
            font-size: 12px;
            padding-left: 3px;
          }
          @media (max-width: 768px) {
            width: 35%;
          }
          &.admin {
            color: #e74c3c;
          }
          &:hover {
            opacity: .5;
          }
        }
        .message {
          width: 85%;
          background: #fff;
          border-left: 1px solid #E7E9EF;
          padding: 5px 15px;
          word-break: break-word;
          @media (max-width: 768px) {
            width: 65%;
          }
          .time {
            //@extend .label;
            //@extend .label-default;
            font-size: 0.8em;
            opacity: 0.8;
            float: right;
          }
          .mod-actions {
            float: right;
            padding-right: 4px;
            font-size: 0.9em;
            a {
              color: inherit;
              opacity: 0.3;
              &:hover {
                opacity: 0.8;
              }
            }
          }
          .video-embed {
            padding: 5px 0 10px 0;
            .video-wrapper {
              max-width: 500px;
              padding-bottom: 32.8%;
              padding-top: 0;
            }
          }
          .autoembed {
            max-width: 300px !important; // Not sure where / how the inline styles are being embedded that were overwriting this. Temp-fix!
          }
          &.pending {
            opacity: 0.4;
          }
        }
      }
    }

    .entry {
      border-top: 1px solid #999;
      height: 40px;
      width: 100%;
      background: #fff;
      flex: 0;
      bottom: 0;
      position: fixed;

      form {
        height: 100%;
        width: 100%;
        display: flex;
      }

      input {
        height: 100%;
        width: 70%;
        padding-left: 10px;
        border: none;
        font-family: "klavika", Helvetica, Arial, sans-serif;
        font-size: 16px;
      }

      button {
        margin: 0;
        width: 10%;
        height: 100%;
        border-radius: 0;
        border: none;
        background-color: #4B5360;
        color: #AAAAAB;
        font-size: 16px;
        line-height: 32px;
        font-family: "klavika", Helvetica, Arial, sans-serif;
        transition: color .2s ease-in;
        @media (max-width: 768px) {
          width: 30%;
        }
        &:hover {
          color: white;
        }
        &:before {
          content: "\f0a9  ";
          font: normal normal normal 16px/1 FontAwesome;
          line-height: 32px;
          -webkit-font-smoothing: antialiased;
        }
      }
    }
  }
}