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
      display: inline;
47 48 49 50

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

      a {
        color: $gl-link-color;
        text-decoration: none;
      }
56 57

      p {
58
        display: inline;
59 60 61 62 63 64
        margin: 0;

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

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

    .note-body {
      overflow: hidden;

      .system-note-commit-list-toggler {
75
        color: $gl-link-color;
76 77 78
        display: none;
        padding: 10px 0 0;
        cursor: pointer;
79 80
        position: relative;
        z-index: 2;
81 82 83 84 85

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

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

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

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

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

          p:first-child {
            display: none;
          }

          &::after {
            content: '';
            width: 100%;
114
            height: 67px;
115 116
            position: absolute;
            left: 0;
117
            bottom: 0;
118
            background: linear-gradient(rgba($white-light, 0.1) -100px, $white-light 100%);
119 120 121 122 123 124 125
          }

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

            &::after {
126
              display: none;
127 128 129 130 131 132
              background: transparent;
            }
          }
        }
      }
    }
133 134

    .timeline-icon {
135 136
      display: none;

137 138
      .avatar {
        visibility: hidden;
139 140 141 142

        .discussion-body & {
          visibility: visible;
        }
143 144 145 146
      }
    }
  }

147 148 149 150
  .discussion-body {
    padding-top: 15px;
  }

151 152 153
  .discussion {
    overflow: hidden;
    display: block;
154
    position: relative;
155 156 157 158
  }

  .note {
    display: block;
159
    position: relative;
A
Annabel Dunstone Gray 已提交
160
    border-bottom: 1px solid $white-normal;
161

162 163 164 165
    &.note-discussion {
      &.timeline-entry {
        padding: 14px 10px;
      }
166 167 168 169

      .system-note {
        padding: 0;
      }
170 171
    }

P
Phil Hughes 已提交
172 173 174 175 176 177 178 179 180
    &.is-editting {
      .note-header,
      .note-text,
      .edited-text {
        display: none;
      }

      .note-edit-form {
        display: block;
F
Fatih Acet 已提交
181 182 183 184

        &.current-note-edit-form + .note-awards {
          display: none;
        }
P
Phil Hughes 已提交
185 186 187
      }
    }

188
    .note-body {
189 190
      overflow-x: auto;
      overflow-y: hidden;
E
Eric Eastwood 已提交
191 192 193
      // Help with emoji cut-off (most noticable in Safari)
      // See https://i.imgur.com/0dg87Y9.png
      padding-top: 1px;
194

195 196 197
      .note-text {
        word-wrap: break-word;
        @include md-typography;
198 199
        // Reset ul style types since we're nested inside a ul already
        @include bulleted-list;
200 201 202
        ul.task-list {
          ul:not(.task-list) {
            padding-left: 1.3em;
203 204
          }
        }
205
      }
206
    }
207

F
Fatih Acet 已提交
208 209
    .note-awards {
      .js-awards-block {
210
        padding: 2px;
F
Fatih Acet 已提交
211 212 213 214
        margin-top: 10px;
      }
    }

215
    .note-header {
D
Dmitriy Zaporozhets 已提交
216
      padding-bottom: 3px;
217 218 219 220 221
      padding-right: 20px;

      @media (min-width: $screen-sm-min) {
        padding-right: 0;
      }
222 223 224 225 226 227

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

F
Fatih Acet 已提交
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
    .note-emoji-button {
      .fa-spinner {
        display: none;
      }

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

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

246 247
  }
}
248

249
.page-sidebar-pinned.right-sidebar-expanded {
250
  @media (max-width: $screen-md-max) {
251 252 253 254 255 256 257 258 259 260 261 262 263 264
    .note-header {
      .note-headline-light {
        display: block;
      }

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

265
// Diff code in discussion view
266
.discussion-body .diff-file {
267 268 269 270 271 272 273 274
  .file-title {
    cursor: default;

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

275 276 277
  .diff-header > span {
    margin-right: 10px;
  }
278

279
  .line_content {
A
Annabel Dunstone 已提交
280
    white-space: pre-wrap;
281
  }
282 283
}

284
.diff-file .notes_holder {
285
  font-family: $regular_font;
286

R
Riyad Preukschas 已提交
287
  td {
A
Annabel Dunstone Gray 已提交
288
    border: 1px solid $white-normal;
R
Riyad Preukschas 已提交
289 290 291
    border-left: none;

    &.notes_line {
292
      vertical-align: middle;
R
Riyad Preukschas 已提交
293 294
      text-align: center;
      padding: 10px 0;
A
Annabel Dunstone Gray 已提交
295
      background: $gray-light;
296
      color: $text-color;
R
Riyad Preukschas 已提交
297
    }
A
Annabel Dunstone 已提交
298

299 300 301
    &.notes_line2 {
      text-align: center;
      padding: 10px 0;
S
Sam Rose 已提交
302
      border-left: 1px solid $note-line2-border !important;
303
    }
A
Annabel Dunstone 已提交
304

R
Riyad Preukschas 已提交
305
    &.notes_content {
A
Annabel Dunstone Gray 已提交
306
      background-color: $gray-light;
R
Riyad Preukschas 已提交
307
      border-width: 1px 0;
P
Phil Hughes 已提交
308
      padding: 0;
309
      vertical-align: top;
310
      white-space: normal;
A
Annabel Dunstone 已提交
311

312
      &.parallel {
313 314
        border-width: 1px;
      }
A
Annabel Dunstone 已提交
315 316 317 318

      .notes {
        background-color: $white-light;
      }
319 320 321 322 323

      a code {
        top: 0;
        margin-right: 0;
      }
R
Riyad Preukschas 已提交
324
    }
325 326
  }
}
327

328 329
.discussion-header,
.note-header {
330 331
  position: relative;

332 333 334 335 336 337 338 339 340
  a {
    color: inherit;

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

341
  .author_link {
T
tauriedavis 已提交
342
    color: $gl-text-color;
343
  }
344 345
}

346 347 348 349
.discussion-header {
  font-size: 14px;
}

350 351 352 353 354 355 356 357
.note-headline-light {
  display: inline;

  @media (max-width: $screen-xs-min) {
    display: block;
  }
}

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

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

369
/**
370
 * Actions for Discussions/Notes
371
 */
372

373 374 375 376
.discussion-actions,
.note-actions {
  float: right;
  margin-left: 10px;
A
Annabel Dunstone Gray 已提交
377
  color: $gray-darkest;
378
}
379

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

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

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

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

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

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

411
  .fa {
A
Annabel Dunstone Gray 已提交
412
    color: $gray-darkest;
P
Phil Hughes 已提交
413 414 415 416
    position: relative;
    font-size: 17px;
  }

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

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

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

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

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

R
Riyad Preukschas 已提交
453

R
Riyad Preukschas 已提交
454
/**
455
 * Line note button on the side of diffs
R
Riyad Preukschas 已提交
456
 */
457

458 459 460 461 462
.add-diff-note {
  display: none;
  margin-top: -2px;
  border-radius: 50%;
  background: $white-light;
P
Phil Hughes 已提交
463
  padding: 1px 5px;
464 465 466 467 468 469 470 471
  font-size: 12px;
  color: $gl-link-color;
  margin-left: -55px;
  position: absolute;
  z-index: 10;
  width: 23px;
  height: 23px;
  border: 1px solid $border-color;
P
Phil Hughes 已提交
472
  transition: transform .1s ease-in-out;
473

474 475 476
  &:hover {
    background: $gl-info;
    color: $white-light;
P
Phil Hughes 已提交
477
    transform: scale(1.15);
478
  }
479

480 481
  &:active {
    outline: 0;
482
  }
483
}
484

485 486
.diff-file {
  .is-over {
R
Riyad Preukschas 已提交
487
    .add-diff-note {
488
      display: inline-block;
489
    }
R
randx 已提交
490
  }
491
}
P
Phil Hughes 已提交
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509

.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 已提交
510

511 512 513 514 515 516 517 518 519 520 521
.line-resolve-all-container {
  .btn-group {
    margin-left: -4px;
  }

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

P
Phil Hughes 已提交
522
.line-resolve-all {
523
  vertical-align: middle;
524
  display: inline-block;
525
  padding: 6px 10px;
A
Annabel Dunstone Gray 已提交
526
  background-color: $gray-light;
P
Phil Hughes 已提交
527
  border: 1px solid $border-color;
528
  border-radius: $border-radius-default;
P
Phil Hughes 已提交
529

530 531 532
  &.has-next-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
533
    border-right: 0;
534 535 536 537
  }

  .line-resolve-btn {
    margin-right: 5px;
P
Phil Hughes 已提交
538 539 540 541
  }
}

.line-resolve-btn {
542
  display: inline-block;
P
Phil Hughes 已提交
543
  position: relative;
544
  top: 2px;
P
Phil Hughes 已提交
545 546
  padding: 0;
  background-color: transparent;
547
  border: none;
P
Phil Hughes 已提交
548 549
  outline: 0;

550 551 552 553
  &.is-disabled {
    cursor: default;
  }

554
  &:not(.is-disabled):hover,
555
  &:not(.is-disabled):focus,
P
Phil Hughes 已提交
556
  &.is-active {
557
    color: $gl-text-green;
P
Phil Hughes 已提交
558

559
    svg {
560
      fill: $gl-text-green;
P
Phil Hughes 已提交
561 562 563
    }
  }

564
  svg {
565
    position: relative;
566
    fill: $gray-darkest;
P
Phil Hughes 已提交
567 568
  }
}
569 570

.discussion-next-btn {
571 572
  svg {
    margin: 0;
573

574 575 576
    path {
      fill: $gray-darkest;
    }
577 578
  }
}
F
Filipa Lacerda 已提交
579 580 581 582 583 584 585 586 587 588 589 590 591 592

// Merge request notes in diffs
.diff-file {
  // Diff is side by side
  .notes_content.parallel .note-header .note-headline-light {
    display: block;
    position: relative;
  }
  // Diff is inline
  .notes_content .note-header .note-headline-light {
    display: inline-block;
    position: relative;
  }
}