notes.scss 5.4 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
  .note-created-ago, .note-updated-at {
A
Alfredo Sumaran 已提交
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;
A
Annabel Dunstone 已提交
61
    border-bottom: 1px solid $table-border-gray;
62

P
Phil Hughes 已提交
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
    .note-body {
76
      overflow: auto;
77

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

J
Jacob Schatz 已提交
83
        // On diffs code should wrap nicely and not overflow
A
Annabel Dunstone 已提交
84 85
        code {
          white-space: pre-wrap;
86 87
        }

88 89 90 91 92 93 94 95 96 97 98 99 100
        // 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;
            }
          }
        }

101 102 103
        ul.task-list {
          ul:not(.task-list) {
            padding-left: 1.3em;
104 105 106
          }
        }

107
        hr {
108
          // Darken 'whitesmoke' a bit to make it more visible in note bodies
109
          border-color: darken(#f5f5f5, 8%);
110
          margin: 10px 0;
111
        }
112 113 114 115

        code {
          word-break: keep-all;
        }
116
      }
117
    }
118

119
    .note-header {
D
Dmitriy Zaporozhets 已提交
120
      padding-bottom: 3px;
121
    }
D
Dmitriy Zaporozhets 已提交
122

123 124
  }
}
125

126
// Diff code in discussion view
127 128 129 130 131
.discussion-body .diff-file {
  .diff-header > span {
    margin-right: 10px;
  }
  .line_content {
A
Annabel Dunstone 已提交
132
    white-space: pre-wrap;
133
  }
134 135
}

136
.diff-file .notes_holder {
137
  font-family: $regular_font;
138

R
Riyad Preukschas 已提交
139
  td {
A
Annabel Dunstone 已提交
140
    border: 1px solid $table-border-gray;
R
Riyad Preukschas 已提交
141 142 143
    border-left: none;

    &.notes_line {
144
      vertical-align: middle;
R
Riyad Preukschas 已提交
145 146
      text-align: center;
      padding: 10px 0;
A
Annabel Dunstone 已提交
147
      background: $background-color;
148
      color: $text-color;
R
Riyad Preukschas 已提交
149
    }
A
Annabel Dunstone 已提交
150

151 152 153 154 155
    &.notes_line2 {
      text-align: center;
      padding: 10px 0;
      border-left: 1px solid #ddd !important;
    }
A
Annabel Dunstone 已提交
156

R
Riyad Preukschas 已提交
157
    &.notes_content {
A
Annabel Dunstone 已提交
158
      background-color: $background-color;
R
Riyad Preukschas 已提交
159
      border-width: 1px 0;
P
Phil Hughes 已提交
160
      padding: 0;
161
      vertical-align: top;
162
      white-space: normal;
A
Annabel Dunstone 已提交
163

164
      &.parallel {
165 166
        border-width: 1px;
      }
A
Annabel Dunstone 已提交
167 168 169 170

      .notes {
        background-color: $white-light;
      }
R
Riyad Preukschas 已提交
171
    }
172 173
  }
}
174

175 176 177 178 179 180 181 182 183 184 185
.discussion-header,
.note-header {
  a {
    color: inherit;

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

186 187 188
  .author_link {
    color: $gl-gray;
  }
189 190 191 192
}

.note-headline-light,
.discussion-headline-light {
P
Phil Hughes 已提交
193
  color: $notes-light-color;
194 195
}

P
Phil Hughes 已提交
196 197 198 199 200 201
.discussion-headline-light {
  a {
    color: $gl-link-color;
  }
}

202
/**
203
 * Actions for Discussions/Notes
204
 */
205

206 207 208 209
.discussion-actions,
.note-actions {
  float: right;
  margin-left: 10px;
P
Phil Hughes 已提交
210
  color: $notes-action-color;
211
}
212

P
Phil Hughes 已提交
213
.discussion-actions {
214
  @media (max-width: $screen-md-max) {
P
Phil Hughes 已提交
215 216 217 218 219 220 221 222 223
    float: none;
    margin-left: 0;

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

224 225
.note-action-button,
.discussion-action-button {
226
  display: inline-block;
227
  margin-left: 10px;
228
  line-height: 24px;
D
Douwe Maan 已提交
229

230
  .fa {
A
Annabel Dunstone 已提交
231
    color: $notes-action-color;
P
Phil Hughes 已提交
232 233 234 235 236
    position: relative;
    top: 1px;
    font-size: 17px;
  }

A
Annabel Dunstone 已提交
237 238 239 240 241 242 243 244 245 246 247 248 249 250
  &.js-note-delete {
    i {
      &:hover {
        color: $gl-text-red;
      }
    }
  }

  &.js-note-edit {
    i {
      &:hover {
        color: $gl-link-color;
      }
    }
251
  }
252
}
253

254 255 256
.discussion-toggle-button {
  line-height: 20px;
  font-size: 13px;
257

258 259 260 261 262
  .fa {
    margin-right: 3px;
    font-size: 10px;
    line-height: 18px;
    vertical-align: top;
263 264
  }
}
265 266 267 268 269 270 271

.note-role {
  position: relative;
  top: -2px;
  display: inline-block;
  padding-left: 4px;
  padding-right: 4px;
P
Phil Hughes 已提交
272
  color: $notes-role-color;
273 274
  font-size: 12px;
  line-height: 20px;
P
Phil Hughes 已提交
275
  border: 1px solid $notes-role-border-color;
276 277 278
  border-radius: $border-radius-base;
}

279
.diff-file .note .note-actions {
280 281
  right: 0;
  top: 0;
D
Dmitriy Zaporozhets 已提交
282 283
}

R
Riyad Preukschas 已提交
284

R
Riyad Preukschas 已提交
285
/**
286
 * Line note button on the side of diffs
R
Riyad Preukschas 已提交
287
 */
288

289
.diff-file tr.line_holder {
290
  @mixin show-add-diff-note {
291
    display: inline-block;
292 293
  }

R
Riyad Preukschas 已提交
294
  .add-diff-note {
295 296
    margin-top: -4px;
    @include border-radius(40px);
297
    background: #fff;
298 299
    padding: 4px;
    font-size: 16px;
D
Dmitriy Zaporozhets 已提交
300
    color: $gl-link-color;
301
    margin-left: -56px;
302 303
    position: absolute;
    z-index: 10;
304
    width: 32px;
305
    // "hide" it by default
306
    display: none;
R
Riyad Preukschas 已提交
307
    &:hover {
308
      background: $gl-info;
309
      color: #fff;
310
      @include show-add-diff-note;
R
Riyad Preukschas 已提交
311
    }
312
  }
313

K
Kevin Lyda 已提交
314
  // "show" the icon also if we just hover somewhere over the line
R
Riyad Preukschas 已提交
315 316
  &:hover > td {
    .add-diff-note {
317
      @include show-add-diff-note;
318
    }
R
randx 已提交
319
  }
320
}
P
Phil Hughes 已提交
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338

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