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

D
Dmitriy Zaporozhets 已提交
5
@-webkit-keyframes targe3-note {
6 7 8
  from { background: #fffff0; }
  50% { background: #ffffd3; }
  to { background: #fffff0; }
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
    padding: 0;
    clear: both;

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

    .system-note-message {
      text-transform: lowercase;

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

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

    .note-body {
      overflow: hidden;

      .system-note-commit-list-toggler {
        display: none;
        padding: 10px 0 0;
        cursor: pointer;
      }

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

        &.system-note-commit-list {
          max-height: 63px;
          overflow: hidden;
          display: block;

          ul {
            margin: 3px 0 3px 15px !important;

            li {
              font-family: $monospace_font;
              font-size: 12px;
            }
          }

          p:first-child {
            display: none;
          }

          &::after {
            content: '';
            width: 100%;
            height: 20px;
            position: absolute;
            left: 0;
            bottom: 50px;
            background: linear-gradient(rgba($gray-light, .3) 0, $white-light);
          }

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

            &::after {
              background: transparent;
            }
          }
        }
      }
    }
111 112

    .timeline-icon {
113 114
      display: none;

115 116
      .avatar {
        visibility: hidden;
117 118 119 120

        .discussion-body & {
          visibility: visible;
        }
121 122 123 124
      }
    }
  }

125 126 127 128
  .discussion-body {
    padding-top: 15px;
  }

129 130 131
  .discussion {
    overflow: hidden;
    display: block;
132
    position: relative;
133 134 135 136
  }

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

140 141 142 143 144 145
    &.note-discussion {
      &.timeline-entry {
        padding: 14px 10px;
      }
    }

P
Phil Hughes 已提交
146 147 148 149 150 151 152 153 154
    &.is-editting {
      .note-header,
      .note-text,
      .edited-text {
        display: none;
      }

      .note-edit-form {
        display: block;
F
Fatih Acet 已提交
155 156 157 158

        &.current-note-edit-form + .note-awards {
          display: none;
        }
P
Phil Hughes 已提交
159 160 161
      }
    }

162
    .note-body {
163
      overflow: auto;
164

165 166 167 168
      .note-text {
        overflow: auto;
        word-wrap: break-word;
        @include md-typography;
169 170
        // Reset ul style types since we're nested inside a ul already
        @include bulleted-list;
171 172 173
        ul.task-list {
          ul:not(.task-list) {
            padding-left: 1.3em;
174 175
          }
        }
176
      }
177
    }
178

F
Fatih Acet 已提交
179 180
    .note-awards {
      .js-awards-block {
181
        padding: 2px;
F
Fatih Acet 已提交
182 183 184 185
        margin-top: 10px;
      }
    }

186
    .note-header {
D
Dmitriy Zaporozhets 已提交
187
      padding-bottom: 3px;
188 189
      padding-right: 20px;

190 191 192 193 194
      p {
        display: inline;
        margin: 0;
      }

195 196 197
      @media (min-width: $screen-sm-min) {
        padding-right: 0;
      }
198 199 200 201 202 203

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

F
Fatih Acet 已提交
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
    .note-emoji-button {
      .fa-spinner {
        display: none;
      }

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

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

222 223
  }
}
224

225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
.page-sidebar-pinned.right-sidebar-expanded {
  @media (max-width: $screen-lg-min) {
    .note-header {
      .note-headline-light {
        display: block;
      }

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

241
// Diff code in discussion view
242
.discussion-body .diff-file {
243 244 245 246 247 248 249 250
  .file-title {
    cursor: default;

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

251 252 253
  .diff-header > span {
    margin-right: 10px;
  }
254

255
  .line_content {
A
Annabel Dunstone 已提交
256
    white-space: pre-wrap;
257
  }
258 259
}

260
.diff-file .notes_holder {
261
  font-family: $regular_font;
262

R
Riyad Preukschas 已提交
263
  td {
A
Annabel Dunstone 已提交
264
    border: 1px solid $table-border-gray;
R
Riyad Preukschas 已提交
265 266 267
    border-left: none;

    &.notes_line {
268
      vertical-align: middle;
R
Riyad Preukschas 已提交
269 270
      text-align: center;
      padding: 10px 0;
A
Annabel Dunstone 已提交
271
      background: $background-color;
272
      color: $text-color;
R
Riyad Preukschas 已提交
273
    }
A
Annabel Dunstone 已提交
274

275 276 277 278 279
    &.notes_line2 {
      text-align: center;
      padding: 10px 0;
      border-left: 1px solid #ddd !important;
    }
A
Annabel Dunstone 已提交
280

R
Riyad Preukschas 已提交
281
    &.notes_content {
A
Annabel Dunstone 已提交
282
      background-color: $background-color;
R
Riyad Preukschas 已提交
283
      border-width: 1px 0;
P
Phil Hughes 已提交
284
      padding: 0;
285
      vertical-align: top;
286
      white-space: normal;
A
Annabel Dunstone 已提交
287

288
      &.parallel {
289 290
        border-width: 1px;
      }
A
Annabel Dunstone 已提交
291 292 293 294

      .notes {
        background-color: $white-light;
      }
295 296 297 298 299

      a code {
        top: 0;
        margin-right: 0;
      }
R
Riyad Preukschas 已提交
300
    }
301 302
  }
}
303

304 305
.discussion-header,
.note-header {
306 307
  position: relative;

308 309 310 311 312 313 314 315 316
  a {
    color: inherit;

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

317 318 319
  .author_link {
    color: $gl-gray;
  }
320 321
}

322 323 324 325
.discussion-header {
  font-size: 14px;
}

326 327
.note-headline-light,
.discussion-headline-light {
P
Phil Hughes 已提交
328
  color: $notes-light-color;
329 330
}

P
Phil Hughes 已提交
331 332 333 334 335 336
.discussion-headline-light {
  a {
    color: $gl-link-color;
  }
}

337
/**
338
 * Actions for Discussions/Notes
339
 */
340

341 342 343 344
.discussion-actions,
.note-actions {
  float: right;
  margin-left: 10px;
P
Phil Hughes 已提交
345
  color: $notes-action-color;
346
}
347

348 349 350 351
.note-actions {
  position: absolute;
  right: 0;
  top: 0;
352 353 354 355 356

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

357 358 359 360 361
  @media (min-width: $screen-sm-min) {
    position: relative;
  }
}

P
Phil Hughes 已提交
362
.discussion-actions {
363
  @media (max-width: $screen-md-max) {
P
Phil Hughes 已提交
364 365 366 367 368 369 370 371 372
    float: none;
    margin-left: 0;

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

D
Douwe Maan 已提交
373
.note-action-button {
374
  display: inline-block;
375 376 377 378 379 380 381
  margin-left: 0;
  line-height: 20px;

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

383
  .fa {
A
Annabel Dunstone 已提交
384
    color: $notes-action-color;
P
Phil Hughes 已提交
385 386 387 388 389
    position: relative;
    top: 1px;
    font-size: 17px;
  }

C
Clement Ho 已提交
390 391 392
  &:hover {
    .danger-highlight {
      color: $gl-text-red;
A
Annabel Dunstone 已提交
393 394
    }

C
Clement Ho 已提交
395 396
    .link-highlight {
      color: $gl-link-color;
A
Annabel Dunstone 已提交
397
    }
398
  }
399
}
400

401 402 403
.discussion-toggle-button {
  line-height: 20px;
  font-size: 13px;
404

405 406 407 408 409
  .fa {
    margin-right: 3px;
    font-size: 10px;
    line-height: 18px;
    vertical-align: top;
410 411
  }
}
412 413 414 415 416 417 418

.note-role {
  position: relative;
  top: -2px;
  display: inline-block;
  padding-left: 4px;
  padding-right: 4px;
P
Phil Hughes 已提交
419
  color: $notes-role-color;
420 421
  font-size: 12px;
  line-height: 20px;
P
Phil Hughes 已提交
422
  border: 1px solid $notes-role-border-color;
423 424 425
  border-radius: $border-radius-base;
}

426
.diff-file .note .note-actions {
427 428
  right: 0;
  top: 0;
D
Dmitriy Zaporozhets 已提交
429 430
}

R
Riyad Preukschas 已提交
431

R
Riyad Preukschas 已提交
432
/**
433
 * Line note button on the side of diffs
R
Riyad Preukschas 已提交
434
 */
435

436
.diff-file tr.line_holder {
437
  @mixin show-add-diff-note {
438
    display: inline-block;
439 440
  }

R
Riyad Preukschas 已提交
441
  .add-diff-note {
442
    margin-top: -4px;
C
Clement Ho 已提交
443
    border-radius: 40px;
444
    background: #fff;
445 446
    padding: 4px;
    font-size: 16px;
D
Dmitriy Zaporozhets 已提交
447
    color: $gl-link-color;
448
    margin-left: -56px;
449 450
    position: absolute;
    z-index: 10;
451
    width: 32px;
452
    // "hide" it by default
453
    display: none;
454

R
Riyad Preukschas 已提交
455
    &:hover {
456
      background: $gl-info;
457
      color: #fff;
458
      @include show-add-diff-note;
R
Riyad Preukschas 已提交
459
    }
460
  }
461

K
Kevin Lyda 已提交
462
  // "show" the icon also if we just hover somewhere over the line
R
Riyad Preukschas 已提交
463 464
  &:hover > td {
    .add-diff-note {
465
      @include show-add-diff-note;
466
    }
R
randx 已提交
467
  }
468
}
P
Phil Hughes 已提交
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486

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

488 489 490 491 492 493 494 495 496 497 498 499
.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 已提交
500
.line-resolve-all {
501 502 503
  display: inline-block;
  padding: 5px 10px;
  background-color: $background-color;
P
Phil Hughes 已提交
504
  border: 1px solid $border-color;
505
  border-radius: $border-radius-default;
P
Phil Hughes 已提交
506

507 508 509 510 511 512
  &.has-next-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .line-resolve-btn {
C
Connor Shea 已提交
513
    vertical-align: middle;
514
    margin-right: 5px;
P
Phil Hughes 已提交
515 516 517 518 519 520 521 522
  }
}

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

.line-resolve-btn {
523
  display: inline-block;
P
Phil Hughes 已提交
524
  position: relative;
525
  top: 2px;
P
Phil Hughes 已提交
526 527
  padding: 0;
  background-color: transparent;
528
  border: none;
P
Phil Hughes 已提交
529 530
  outline: 0;

531 532 533 534
  &.is-disabled {
    cursor: default;
  }

535
  &:not(.is-disabled):hover,
536
  &:not(.is-disabled):focus,
P
Phil Hughes 已提交
537
  &.is-active {
538
    color: $gl-text-green;
P
Phil Hughes 已提交
539

540 541
    svg path {
      fill: $gl-text-green;
P
Phil Hughes 已提交
542 543 544
    }
  }

545
  svg {
546
    position: relative;
547
    color: $notes-action-color;
548 549 550 551

    path {
      fill: $notes-action-color;
    }
P
Phil Hughes 已提交
552 553
  }
}
554 555

.discussion-next-btn {
556 557
  svg {
    margin: 0;
558

559 560 561
    path {
      fill: $gray-darkest;
    }
562 563
  }
}