@import 'variables';

@avatar-size: 20px;

.github-PrTimeline {
  margin-top: @component-padding * 3;
  border-top: 1px solid mix(@text-color, @base-background-color, 15%);

  // all items
  & > * {
    margin: 0 @component-padding * 3;
    padding: @component-padding*3 0;
    border-bottom: 1px solid mix(@text-color, @base-background-color, 15%);
  }

  .emoji,
  g-emoji {
    margin-right: .25em;
  }


  .author-avatar {
    width: @avatar-size;
    height: @avatar-size;
    margin-right: 5px;
  }

  .pre-timeline-item-icon {
    position: absolute;
    margin-left: -25px;
    margin-top: 2px;
    color: @text-color-subtle;
  }

  .commits {
    .info-row {
      margin-bottom: @component-padding;
    }
  }

  .commit {
    display: table-row;
    align-items: center;
    margin-left: @component-padding * 2;

    &:first-child {
      padding-top: @component-padding;
    }

    &:only-child {
      padding-top: 0;
      padding-bottom: 0;
      margin-left: -@component-padding;
    }

    & + .issue {
      margin-top: @component-padding/2;
    }

    .commit-author {
      display: table-cell;
      white-space: nowrap;
      text-align: right;
    }

    .author-avatar {
      flex-basis: @avatar-size;
    }

    .commit-message-headline {
      display: table-cell;
      font-size: .9em;
      padding: 0 @component-padding/3;
      max-height: @avatar-size;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      max-width: 0; // this makes sure the ellipsis work in table-cell
      width: 100%;
    }

    .commit-sha {
      display: table-cell;
      text-align: right;
      font-family: monospace;
      padding-left: 5px;
      font-size: .85em;
      color: @text-color-subtle;
    }
  }

  .merged-event {
    display: flex;
    align-items: center;
    font-size: .9em;
    line-height: 1.3;
    color: @text-color-subtle;
    border-bottom: 4px double @base-border-color;

    .username,
    .merge-ref {
      font-weight: bold;
      color: @text-color-highlight;
    }

    .sha {
      font-family: monospace;
    }
  }

  .merged-event ~ .issue {
    border-bottom-style: dashed;
  }

  .issue {

    .info-row {
      margin-bottom: @component-padding/1.5;
    }
    .comment-message-header {
      font-size: .9em;
      color: @text-color-subtle;
    }

    .github-DotComMarkdownHtml {

      p:last-child {
        margin-bottom: 0;
      }

      pre > code {
        white-space: pre;
      }
    }
  }


}
