notes.scss 9.5 KB
Newer Older
D
Dmitriy Zaporozhets 已提交
1 2 3
/**
 * Notes
 */
4

D
Dmitriy Zaporozhets 已提交
5
@-webkit-keyframes targe3-note {
S
Sam Rose 已提交
6 7 8
  from { background: $note-targe3-outside; }
  50% { background: $note-targe3-inside; }
  to { background: $note-targe3-outside; }
9 10
}

11
ul.notes {
12 13
  display: block;
  list-style: none;
14 15
  margin: 0;
  padding: 0;
16

A
Alfredo Sumaran 已提交
17 18 19 20 21
  .timeline-icon {
    float: left;
  }

  .timeline-content {
A
Alfredo Sumaran 已提交
22
    margin-left: 55px;
P
Phil Hughes 已提交
23 24 25 26 27 28

    &.timeline-content-form {
      @media (max-width: $screen-sm-max) {
        margin-left: 0;
      }
    }
A
Alfredo Sumaran 已提交
29 30
  }

31 32
  .note-created-ago,
  .note-updated-at {
A
Alfredo Sumaran 已提交
33 34 35
    white-space: nowrap;
  }

36 37
  .system-note {
    font-size: 14px;
38 39 40 41 42 43 44 45
    padding: 0;
    clear: both;

    &.timeline-entry::after {
      clear: none;
    }

    .system-note-message {
46 47 48 49 50
      display: inline-block;

      &::first-letter {
        text-transform: lowercase;
      }
51 52 53 54 55

      a {
        color: $gl-link-color;
        text-decoration: none;
      }
56 57 58 59 60 61 62 63 64

      p {
        display: inline-block;
        margin: 0;

        &::first-letter {
          text-transform: lowercase;
        }
      }
65 66 67 68 69 70 71 72 73 74 75 76 77
    }

    .timeline-content {
      padding: 14px 10px;
    }

    .note-body {
      overflow: hidden;

      .system-note-commit-list-toggler {
        display: none;
        padding: 10px 0 0;
        cursor: pointer;
78 79
        position: relative;
        z-index: 2;
80 81 82 83 84

        &:hover {
          color: $gl-link-color;
          text-decoration: underline;
        }
85 86 87 88 89 90 91 92
      }

      .note-text {
        & p:first-child {
          display: none;
        }

        &.system-note-commit-list {
N
Nur Rony 已提交
93
          max-height: 70px;
94 95 96 97
          overflow: hidden;
          display: block;

          ul {
N
Nur Rony 已提交
98
            margin: 3px 0 3px 16px !important;
99

100
            .gfm-commit {
101 102 103 104 105 106 107 108 109
              font-family: $monospace_font;
              font-size: 12px;
            }
          }

          p:first-child {
            display: none;
          }

110 111 112 113 114 115 116 117 118 119
          p:last-child {
            a {
              color: $gl-text-color;

              &:hover {
                color: $gl-link-color;
              }
            }
          }

120 121 122
          &::after {
            content: '';
            width: 100%;
123
            height: 67px;
124 125
            position: absolute;
            left: 0;
126
            bottom: 0;
127
            background: linear-gradient(rgba($white-light, 0.1) -100px, $white-light 100%);
128 129 130 131 132 133 134
          }

          &.hide-shade {
            max-height: 100%;
            overflow: auto;

            &::after {
135
              display: none;
136 137 138 139 140 141
              background: transparent;
            }
          }
        }
      }
    }
142 143

    .timeline-icon {
144 145
      display: none;

146 147
      .avatar {
        visibility: hidden;
148 149 150 151

        .discussion-body & {
          visibility: visible;
        }
152 153 154 155
      }
    }
  }

156 157 158 159
  .discussion-body {
    padding-top: 15px;
  }

160 161 162
  .discussion {
    overflow: hidden;
    display: block;
163
    position: relative;
164 165 166 167
  }

  .note {
    display: block;
168
    position: relative;
A
Annabel Dunstone 已提交
169
    border-bottom: 1px solid $table-border-gray;
170

171 172 173 174
    &.note-discussion {
      &.timeline-entry {
        padding: 14px 10px;
      }
175 176 177 178

      .system-note {
        padding: 0;
      }
179 180
    }

P
Phil Hughes 已提交
181 182 183 184 185 186 187 188 189
    &.is-editting {
      .note-header,
      .note-text,
      .edited-text {
        display: none;
      }

      .note-edit-form {
        display: block;
F
Fatih Acet 已提交
190 191 192 193

        &.current-note-edit-form + .note-awards {
          display: none;
        }
P
Phil Hughes 已提交
194 195 196
      }
    }

197
    .note-body {
198
      overflow: auto;
199

200 201 202 203
      .note-text {
        overflow: auto;
        word-wrap: break-word;
        @include md-typography;
204 205
        // Reset ul style types since we're nested inside a ul already
        @include bulleted-list;
206 207 208
        ul.task-list {
          ul:not(.task-list) {
            padding-left: 1.3em;
209 210
          }
        }
211
      }
212
    }
213

F
Fatih Acet 已提交
214 215
    .note-awards {
      .js-awards-block {
216
        padding: 2px;
F
Fatih Acet 已提交
217 218 219 220
        margin-top: 10px;
      }
    }

221
    .note-header {
D
Dmitriy Zaporozhets 已提交
222
      padding-bottom: 3px;
223 224 225 226 227
      padding-right: 20px;

      @media (min-width: $screen-sm-min) {
        padding-right: 0;
      }
228 229 230 231 232 233

      @media (max-width: $screen-xs-min) {
        .inline {
          display: block;
        }
      }
234
    }
D
Dmitriy Zaporozhets 已提交
235

F
Fatih Acet 已提交
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
    .note-emoji-button {
      .fa-spinner {
        display: none;
      }

      &.is-loading {
        .fa-smile-o {
          display: none;
        }

        .fa-spinner {
          display: inline-block;
        }
      }
    }

252 253
  }
}
254

255
.page-sidebar-pinned.right-sidebar-expanded {
256
  @media (max-width: $screen-md-max) {
257 258 259 260 261 262 263 264 265 266 267 268 269 270
    .note-header {
      .note-headline-light {
        display: block;
      }

      .note-actions {
        position: absolute;
        right: 0;
        top: 0;
      }
    }
  }
}

271
// Diff code in discussion view
272
.discussion-body .diff-file {
273 274 275 276 277 278 279 280
  .file-title {
    cursor: default;

    &:hover {
      background-color: $gray-light;
    }
  }

281 282 283
  .diff-header > span {
    margin-right: 10px;
  }
284

285
  .line_content {
A
Annabel Dunstone 已提交
286
    white-space: pre-wrap;
287
  }
288 289
}

290
.diff-file .notes_holder {
291
  font-family: $regular_font;
292

R
Riyad Preukschas 已提交
293
  td {
A
Annabel Dunstone 已提交
294
    border: 1px solid $table-border-gray;
R
Riyad Preukschas 已提交
295 296 297
    border-left: none;

    &.notes_line {
298
      vertical-align: middle;
R
Riyad Preukschas 已提交
299 300
      text-align: center;
      padding: 10px 0;
A
Annabel Dunstone 已提交
301
      background: $background-color;
302
      color: $text-color;
R
Riyad Preukschas 已提交
303
    }
A
Annabel Dunstone 已提交
304

305 306 307
    &.notes_line2 {
      text-align: center;
      padding: 10px 0;
S
Sam Rose 已提交
308
      border-left: 1px solid $note-line2-border !important;
309
    }
A
Annabel Dunstone 已提交
310

R
Riyad Preukschas 已提交
311
    &.notes_content {
A
Annabel Dunstone 已提交
312
      background-color: $background-color;
R
Riyad Preukschas 已提交
313
      border-width: 1px 0;
P
Phil Hughes 已提交
314
      padding: 0;
315
      vertical-align: top;
316
      white-space: normal;
A
Annabel Dunstone 已提交
317

318
      &.parallel {
319 320
        border-width: 1px;
      }
A
Annabel Dunstone 已提交
321 322 323 324

      .notes {
        background-color: $white-light;
      }
325 326 327 328 329

      a code {
        top: 0;
        margin-right: 0;
      }
R
Riyad Preukschas 已提交
330
    }
331 332
  }
}
333

334 335
.discussion-header,
.note-header {
336 337
  position: relative;

338 339 340 341 342 343 344 345 346
  a {
    color: inherit;

    &:hover {
      color: $gl-link-color;
      text-decoration: none;
    }
  }

347 348 349
  .author_link {
    color: $gl-gray;
  }
350 351
}

352 353 354 355
.discussion-header {
  font-size: 14px;
}

356 357
.note-headline-light,
.discussion-headline-light {
P
Phil Hughes 已提交
358
  color: $notes-light-color;
359 360
}

P
Phil Hughes 已提交
361 362 363 364 365 366
.discussion-headline-light {
  a {
    color: $gl-link-color;
  }
}

367
/**
368
 * Actions for Discussions/Notes
369
 */
370

371 372 373 374
.discussion-actions,
.note-actions {
  float: right;
  margin-left: 10px;
P
Phil Hughes 已提交
375
  color: $notes-action-color;
376
}
377

378 379 380 381
.note-actions {
  position: absolute;
  right: 0;
  top: 0;
382 383 384 385 386

  .note-action-button {
    margin-left: 10px;
  }

387 388 389 390 391
  @media (min-width: $screen-sm-min) {
    position: relative;
  }
}

P
Phil Hughes 已提交
392
.discussion-actions {
393
  @media (max-width: $screen-md-max) {
P
Phil Hughes 已提交
394 395 396 397 398 399 400 401 402
    float: none;
    margin-left: 0;

    .note-action-button {
      margin-left: 0;
    }
  }
}

D
Douwe Maan 已提交
403
.note-action-button {
404
  display: inline-block;
405 406 407 408 409 410 411
  margin-left: 0;
  line-height: 20px;

  @media (min-width: $screen-sm-min) {
    margin-left: 10px;
    line-height: 24px;
  }
D
Douwe Maan 已提交
412

413
  .fa {
A
Annabel Dunstone 已提交
414
    color: $notes-action-color;
P
Phil Hughes 已提交
415 416 417 418
    position: relative;
    font-size: 17px;
  }

C
Clement Ho 已提交
419 420 421
  &:hover {
    .danger-highlight {
      color: $gl-text-red;
A
Annabel Dunstone 已提交
422 423
    }

C
Clement Ho 已提交
424 425
    .link-highlight {
      color: $gl-link-color;
A
Annabel Dunstone 已提交
426
    }
427
  }
428
}
429

430 431 432
.discussion-toggle-button {
  line-height: 20px;
  font-size: 13px;
433

434 435 436 437 438
  .fa {
    margin-right: 3px;
    font-size: 10px;
    line-height: 18px;
    vertical-align: top;
439 440
  }
}
441 442 443 444 445 446 447

.note-role {
  position: relative;
  top: -2px;
  display: inline-block;
  padding-left: 4px;
  padding-right: 4px;
P
Phil Hughes 已提交
448
  color: $notes-role-color;
449 450
  font-size: 12px;
  line-height: 20px;
P
Phil Hughes 已提交
451
  border: 1px solid $notes-role-border-color;
452 453 454
  border-radius: $border-radius-base;
}

455
.diff-file .note .note-actions {
456 457
  right: 0;
  top: 0;
D
Dmitriy Zaporozhets 已提交
458 459
}

R
Riyad Preukschas 已提交
460

R
Riyad Preukschas 已提交
461
/**
462
 * Line note button on the side of diffs
R
Riyad Preukschas 已提交
463
 */
464

465
.diff-file tr.line_holder {
466
  @mixin show-add-diff-note {
467
    display: inline-block;
468 469
  }

R
Riyad Preukschas 已提交
470
  .add-diff-note {
471
    margin-top: -4px;
C
Clement Ho 已提交
472
    border-radius: 40px;
S
Sam Rose 已提交
473
    background: $white-light;
474 475
    padding: 4px;
    font-size: 16px;
D
Dmitriy Zaporozhets 已提交
476
    color: $gl-link-color;
477
    margin-left: -56px;
478 479
    position: absolute;
    z-index: 10;
480
    width: 32px;
481
    // "hide" it by default
482
    display: none;
483

R
Riyad Preukschas 已提交
484
    &:hover {
485
      background: $gl-info;
S
Sam Rose 已提交
486
      color: $white-light;
487
      @include show-add-diff-note;
R
Riyad Preukschas 已提交
488
    }
489
  }
490

K
Kevin Lyda 已提交
491
  // "show" the icon also if we just hover somewhere over the line
R
Riyad Preukschas 已提交
492 493
  &:hover > td {
    .add-diff-note {
494
      @include show-add-diff-note;
495
    }
R
randx 已提交
496
  }
497
}
P
Phil Hughes 已提交
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515

.disabled-comment {
  margin-left: -$gl-padding-top;
  margin-right: -$gl-padding-top;
  background-color: $gray-light;
  border-radius: $border-radius-base;
  border: 1px solid $border-gray-normal;
  color: $note-disabled-comment-color;
  line-height: 200px;

  .disabled-comment-text {
    line-height: normal;
  }

  a {
    color: $gl-link-color;
  }
}
P
Phil Hughes 已提交
516

517 518 519 520 521 522 523 524 525 526 527 528
.line-resolve-all-container {
  .btn-group {
    margin-top: -1px;
    margin-left: -4px;
  }

  .discussion-next-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}

P
Phil Hughes 已提交
529
.line-resolve-all {
530 531 532
  display: inline-block;
  padding: 5px 10px;
  background-color: $background-color;
P
Phil Hughes 已提交
533
  border: 1px solid $border-color;
534
  border-radius: $border-radius-default;
P
Phil Hughes 已提交
535

536 537 538 539 540 541
  &.has-next-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .line-resolve-btn {
C
Connor Shea 已提交
542
    vertical-align: middle;
543
    margin-right: 5px;
P
Phil Hughes 已提交
544 545 546 547 548 549 550 551
  }
}

.line-resolve-text {
  vertical-align: middle;
}

.line-resolve-btn {
552
  display: inline-block;
P
Phil Hughes 已提交
553
  position: relative;
554
  top: 2px;
P
Phil Hughes 已提交
555 556
  padding: 0;
  background-color: transparent;
557
  border: none;
P
Phil Hughes 已提交
558 559
  outline: 0;

560 561 562 563
  &.is-disabled {
    cursor: default;
  }

564
  &:not(.is-disabled):hover,
565
  &:not(.is-disabled):focus,
P
Phil Hughes 已提交
566
  &.is-active {
567
    color: $gl-text-green;
P
Phil Hughes 已提交
568

569 570
    svg path {
      fill: $gl-text-green;
P
Phil Hughes 已提交
571 572 573
    }
  }

574
  svg {
575
    position: relative;
576
    color: $notes-action-color;
577 578 579 580

    path {
      fill: $notes-action-color;
    }
P
Phil Hughes 已提交
581 582
  }
}
583 584

.discussion-next-btn {
585 586
  svg {
    margin: 0;
587

588 589 590
    path {
      fill: $gray-darkest;
    }
591 592
  }
}