notes.scss 5.56 KB
Newer Older
1
2
3
4
5
/**
 * Notes
 */

@-webkit-keyframes targe3-note {
6
7
8
  from { background: #fffff0; }
  50% { background: #ffffd3; }
  to { background: #fffff0; }
9
10
11
12
13
}

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

Alfredo Sumaran's avatar
Alfredo Sumaran committed
17
18
19
20
21
  .timeline-icon {
    float: left;
  }

  .timeline-content {
Alfredo Sumaran's avatar
Alfredo Sumaran committed
22
    margin-left: 55px;
23
24
25
26
27
28

    &.timeline-content-form {
      @media (max-width: $screen-sm-max) {
        margin-left: 0;
      }
    }
Alfredo Sumaran's avatar
Alfredo Sumaran committed
29
30
  }

31
  .note-created-ago, .note-updated-at {
Alfredo Sumaran's avatar
Alfredo Sumaran committed
32
33
34
    white-space: nowrap;
  }

35
36
37
38
  .system-note {
    font-size: 14px;
    padding-top: 10px;
    padding-bottom: 10px;
39
    background: #fdfdfd;
40
41
42
43
44
45
46
47

    .timeline-icon {
      .avatar {
        visibility: hidden;
      }
    }
  }

48
49
50
51
  .discussion-body {
    padding-top: 15px;
  }

52
53
54
  .discussion {
    overflow: hidden;
    display: block;
55
    position: relative;
56
57
58
59
  }

  .note {
    display: block;
60
    position: relative;
Annabel Dunstone's avatar
Annabel Dunstone committed
61
    border-bottom: 1px solid $table-border-gray;
62

Phil Hughes's avatar
Phil Hughes committed
63
64
65
66
67
68
69
70
71
72
73
74
    &.is-editting {
      .note-header,
      .note-text,
      .edited-text {
        display: none;
      }

      .note-edit-form {
        display: block;
      }
    }

75
76
    .note-body {
      overflow: auto;
77

78
79
80
81
82
      .note-text {
        overflow: auto;
        word-wrap: break-word;
        @include md-typography;

83
        // On diffs code should wrap nicely and not overflow
Annabel Dunstone's avatar
Annabel Dunstone committed
84
        p {
85
          code {
Annabel Dunstone's avatar
Annabel Dunstone committed
86
87
88
89
90
91
92
            white-space: normal;
          }

          pre {
            code {
              white-space: pre;
            }
93
94
95
          }
        }

96
97
98
99
100
101
102
103
104
105
106
107
108
        // Reset ul style types since we're nested inside a ul already
        & > ul {
          list-style-type: disc;

          ul {
            list-style-type: circle;

            ul {
              list-style-type: square;
            }
          }
        }

109
110
111
        ul.task-list {
          ul:not(.task-list) {
            padding-left: 1.3em;
112
113
114
          }
        }

115
        hr {
116
          // Darken 'whitesmoke' a bit to make it more visible in note bodies
117
          border-color: darken(#f5f5f5, 8%);
118
          margin: 10px 0;
119
120
        }
      }
Annabel Dunstone's avatar
Annabel Dunstone committed
121
122
123
124

      a {
        word-break: break-all;
      }
125
    }
126

127
128
129
130
131
132
133
    .note-header {
      padding-bottom: 3px;
    }

  }
}

134
// Diff code in discussion view
135
136
137
138
139
.discussion-body .diff-file {
  .diff-header > span {
    margin-right: 10px;
  }
  .line_content {
Annabel Dunstone's avatar
Annabel Dunstone committed
140
    white-space: pre;
141
  }
142
143
}

144
145
146
147
.diff-file .notes_holder {
  font-family: $regular_font;

  td {
Annabel Dunstone's avatar
Annabel Dunstone committed
148
    border: 1px solid $table-border-gray;
149
150
151
    border-left: none;

    &.notes_line {
152
      vertical-align: middle;
153
154
      text-align: center;
      padding: 10px 0;
Annabel Dunstone's avatar
Annabel Dunstone committed
155
      background: $background-color;
156
      color: $text-color;
157
    }
Annabel Dunstone's avatar
Annabel Dunstone committed
158

159
160
161
162
163
    &.notes_line2 {
      text-align: center;
      padding: 10px 0;
      border-left: 1px solid #ddd !important;
    }
Annabel Dunstone's avatar
Annabel Dunstone committed
164

165
    &.notes_content {
Annabel Dunstone's avatar
Annabel Dunstone committed
166
      background-color: $background-color;
167
      border-width: 1px 0;
Phil Hughes's avatar
Phil Hughes committed
168
      padding: 0;
169
      vertical-align: top;
170
      white-space: normal;
Annabel Dunstone's avatar
Annabel Dunstone committed
171

172
      &.parallel {
173
        border-width: 1px;
Annabel Dunstone's avatar
Annabel Dunstone committed
174
175
176
177
178

        .code,
        code {
          white-space: pre-wrap;
        }
179
      }
Annabel Dunstone's avatar
Annabel Dunstone committed
180
181
182
183

      .notes {
        background-color: $white-light;
      }
184
185
186
187
    }
  }
}

188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
.discussion-header,
.note-header {
  a {
    color: inherit;

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

}

.note-headline-light,
.discussion-headline-light {
Phil Hughes's avatar
Phil Hughes committed
203
  color: $notes-light-color;
204
205
}

Phil Hughes's avatar
Phil Hughes committed
206
207
208
209
210
211
.discussion-headline-light {
  a {
    color: $gl-link-color;
  }
}

212
213
214
215
/**
 * Actions for Discussions/Notes
 */

216
217
218
219
.discussion-actions,
.note-actions {
  float: right;
  margin-left: 10px;
Phil Hughes's avatar
Phil Hughes committed
220
  color: $notes-action-color;
221
}
222

Phil Hughes's avatar
Phil Hughes committed
223
224
225
226
227
228
229
230
231
232
233
.discussion-actions {
  @media (max-width: $screen-sm-max) {
    float: none;
    margin-left: 0;

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

234
235
.note-action-button,
.discussion-action-button {
236
  display: inline-block;
237
  margin-left: 10px;
238
  line-height: 24px;
Douwe Maan's avatar
Douwe Maan committed
239

240
  .fa {
Annabel Dunstone's avatar
Annabel Dunstone committed
241
    color: $notes-action-color;
Phil Hughes's avatar
Phil Hughes committed
242
243
244
245
246
    position: relative;
    top: 1px;
    font-size: 17px;
  }

Annabel Dunstone's avatar
Annabel Dunstone committed
247
248
249
250
251
252
253
254
255
256
257
258
259
260
  &.js-note-delete {
    i {
      &:hover {
        color: $gl-text-red;
      }
    }
  }

  &.js-note-edit {
    i {
      &:hover {
        color: $gl-link-color;
      }
    }
261
  }
262
}
263

264
265
266
.discussion-toggle-button {
  line-height: 20px;
  font-size: 13px;
267

268
269
270
271
272
  .fa {
    margin-right: 3px;
    font-size: 10px;
    line-height: 18px;
    vertical-align: top;
273
274
  }
}
275
276
277
278
279
280
281

.note-role {
  position: relative;
  top: -2px;
  display: inline-block;
  padding-left: 4px;
  padding-right: 4px;
Phil Hughes's avatar
Phil Hughes committed
282
  color: $notes-role-color;
283
284
  font-size: 12px;
  line-height: 20px;
Phil Hughes's avatar
Phil Hughes committed
285
  border: 1px solid $notes-role-border-color;
286
287
288
  border-radius: $border-radius-base;
}

289
290
291
292
293
294
295
296
297
298
299
300
.diff-file .note .note-actions {
  right: 0;
  top: 0;
}


/**
 * Line note button on the side of diffs
 */

.diff-file tr.line_holder {
  @mixin show-add-diff-note {
301
    display: inline-block;
302
303
304
305
306
  }

  .add-diff-note {
    margin-top: -4px;
    @include border-radius(40px);
307
    background: #fff;
308
309
310
311
312
313
    padding: 4px;
    font-size: 16px;
    color: $gl-link-color;
    margin-left: -60px;
    position: absolute;
    z-index: 10;
314
    width: 32px;
315
    // "hide" it by default
316
    display: none;
317
    &:hover {
318
      background: $gl-info;
319
      color: #fff;
320
321
322
323
324
325
326
327
328
329
330
      @include show-add-diff-note;
    }
  }

  // "show" the icon also if we just hover somewhere over the line
  &:hover > td {
    .add-diff-note {
      @include show-add-diff-note;
    }
  }
}
Phil Hughes's avatar
Phil Hughes committed
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348

.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;
  }
}