notes.scss 4.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;
A
Alfredo Sumaran 已提交
23 24
  }

25
  .note-created-ago, .note-updated-at {
A
Alfredo Sumaran 已提交
26 27 28
    white-space: nowrap;
  }

29 30 31 32
  .system-note {
    font-size: 14px;
    padding-top: 10px;
    padding-bottom: 10px;
33
    background: #fdfdfd;
34 35 36 37 38 39 40 41

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

42 43 44 45
  .discussion-body {
    padding-top: 15px;
  }

46 47 48
  .discussion {
    overflow: hidden;
    display: block;
49
    position: relative;
50 51 52 53
  }

  .note {
    display: block;
54
    position: relative;
55

P
Phil Hughes 已提交
56 57 58 59 60 61 62 63 64 65 66 67
    &.is-editting {
      .note-header,
      .note-text,
      .edited-text {
        display: none;
      }

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

68
    .note-body {
69
      overflow: auto;
70

71 72 73 74
      .note-text {
        overflow: auto;
        word-wrap: break-word;
        @include md-typography;
75

J
Jacob Schatz 已提交
76
        // On diffs code should wrap nicely and not overflow
77 78 79 80 81 82
        pre {
          code {
            white-space: pre-wrap;
          }
        }

83 84 85 86 87 88 89 90 91 92 93 94 95
        // 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;
            }
          }
        }

96 97 98
        ul.task-list {
          ul:not(.task-list) {
            padding-left: 1.3em;
99 100 101
          }
        }

102
        hr {
103
          // Darken 'whitesmoke' a bit to make it more visible in note bodies
104
          border-color: darken(#f5f5f5, 8%);
105
          margin: 10px 0;
106
        }
107
      }
108
    }
109

110
    .note-header {
D
Dmitriy Zaporozhets 已提交
111
      padding-bottom: 3px;
112
    }
D
Dmitriy Zaporozhets 已提交
113 114

    &:last-child {
115
      border-bottom: 1px solid $border-color;
D
Dmitriy Zaporozhets 已提交
116
    }
117 118
  }
}
119

120
// Diff code in discussion view
121 122 123 124 125 126 127
.discussion-body .diff-file {
  .diff-header > span {
    margin-right: 10px;
  }
  .line_content {
    white-space: pre-wrap;
  }
128 129
}

130
.diff-file .notes_holder {
131
  font-family: $regular_font;
132

R
Riyad Preukschas 已提交
133 134 135 136 137
  td {
    border: 1px solid #ddd;
    border-left: none;

    &.notes_line {
138
      vertical-align: middle;
R
Riyad Preukschas 已提交
139 140
      text-align: center;
      padding: 10px 0;
141
      background: #fff;
142
      color: $text-color;
R
Riyad Preukschas 已提交
143
    }
144 145 146 147 148
    &.notes_line2 {
      text-align: center;
      padding: 10px 0;
      border-left: 1px solid #ddd !important;
    }
R
Riyad Preukschas 已提交
149
    &.notes_content {
150
      background-color: #fff;
R
Riyad Preukschas 已提交
151 152
      border-width: 1px 0;
      padding-top: 0;
153
      vertical-align: top;
154 155 156
      &.parallel{
        border-width: 1px;
      }
R
Riyad Preukschas 已提交
157
    }
158 159
  }
}
160

161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
.discussion-header,
.note-header {
  a {
    color: inherit;

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

  .author_link {
    font-weight: 600;
  }
}

.note-headline-light,
.discussion-headline-light {
P
Phil Hughes 已提交
179
  color: $notes-light-color;
180 181
}

182
/**
183
 * Actions for Discussions/Notes
184
 */
185

186 187 188 189
.discussion-actions,
.note-actions {
  float: right;
  margin-left: 10px;
P
Phil Hughes 已提交
190
  color: $notes-action-color;
191
}
192

193 194
.note-action-button,
.discussion-action-button {
195
  display: inline-block;
196
  margin-left: 10px;
197
  line-height: 24px;
D
Douwe Maan 已提交
198

199 200 201
  .fa {
    font-size: 16px;
  }
202
}
203

204 205 206
.discussion-toggle-button {
  line-height: 20px;
  font-size: 13px;
207

208 209 210 211 212
  .fa {
    margin-right: 3px;
    font-size: 10px;
    line-height: 18px;
    vertical-align: top;
213 214
  }
}
215 216 217 218 219 220 221

.note-role {
  position: relative;
  top: -2px;
  display: inline-block;
  padding-left: 4px;
  padding-right: 4px;
P
Phil Hughes 已提交
222
  color: $notes-action-color;
223 224
  font-size: 12px;
  line-height: 20px;
P
Phil Hughes 已提交
225
  border: 1px solid $notes-role-border-color;
226 227 228
  border-radius: $border-radius-base;
}

229
.diff-file .note .note-actions {
230 231
  right: 0;
  top: 0;
D
Dmitriy Zaporozhets 已提交
232 233
}

R
Riyad Preukschas 已提交
234

R
Riyad Preukschas 已提交
235
/**
236
 * Line note button on the side of diffs
R
Riyad Preukschas 已提交
237
 */
238

239
.diff-file tr.line_holder {
240 241 242 243 244
  @mixin show-add-diff-note {
    filter: alpha(opacity=100);
    opacity: 1.0;
  }

R
Riyad Preukschas 已提交
245
  .add-diff-note {
246 247
    margin-top: -4px;
    @include border-radius(40px);
248
    background: #fff;
249 250
    padding: 4px;
    font-size: 16px;
D
Dmitriy Zaporozhets 已提交
251
    color: $gl-link-color;
252
    margin-left: -60px;
253 254
    position: absolute;
    z-index: 10;
255
    width: 32px;
256

257 258
    transition: all 0.2s ease;

259
    // "hide" it by default
R
Riyad Preukschas 已提交
260 261
    opacity: 0.0;
    filter: alpha(opacity=0);
262

R
Riyad Preukschas 已提交
263
    &:hover {
264
      background: $gl-info;
265
      color: #fff;
266
      @include show-add-diff-note;
R
Riyad Preukschas 已提交
267
    }
268
  }
269

K
Kevin Lyda 已提交
270
  // "show" the icon also if we just hover somewhere over the line
R
Riyad Preukschas 已提交
271 272
  &:hover > td {
    .add-diff-note {
273
      @include show-add-diff-note;
274
    }
R
randx 已提交
275
  }
276
}