files.scss 7.5 KB
Newer Older
1 2 3 4
/**
 * File content holder
 *
 */
5
.file-holder {
6
  border: 1px solid $border-color;
7
  border-radius: $border-radius-default;
8

P
Phil Hughes 已提交
9 10 11 12
  &.file-holder-no-border {
    border: 0;
  }

13 14 15 16
  &.file-holder-bottom-radius {
    border-radius: 0 0 $border-radius-small $border-radius-small;
  }

D
Douwe Maan 已提交
17
  &.readme-holder {
18
    margin: $gl-padding 0;
P
Phil Hughes 已提交
19 20

    &.limited-width-container .file-content {
21
      max-width: $limited-layout-width;
P
Phil Hughes 已提交
22 23 24
      margin-left: auto;
      margin-right: auto;
    }
D
Douwe Maan 已提交
25 26
  }

C
Clement Ho 已提交
27
  &:not(.use-csslab) table {
28 29 30
    @extend .table;
  }

31
  .file-title {
32
    position: relative;
A
Annabel Dunstone Gray 已提交
33
    background-color: $gray-light;
34
    border-bottom: 1px solid $border-color;
35 36
    margin: 0;
    text-align: left;
37
    padding: 10px $gl-padding;
38
    word-wrap: break-word;
39

P
Phil Hughes 已提交
40 41 42 43 44 45 46 47 48 49
    &.file-title-clear {
      padding-left: 0;
      padding-right: 0;
      background-color: transparent;

      .file-actions {
        right: 0;
      }
    }

50
    .file-actions {
51 52 53
      position: absolute;
      top: 5px;
      right: 15px;
54 55

      .btn {
56
        padding: 0 10px;
57 58 59
        font-size: 13px;
        line-height: 28px;
      }
60 61
    }

A
Annabel Dunstone 已提交
62
    a:not(.btn) {
63
      color: $gl-text-color;
64 65
    }

S
skv-headless 已提交
66 67 68
    .left-options {
      margin-top: -3px;
    }
69
  }
70

J
Jeff Stubler 已提交
71 72 73 74
  .file-blame-legend {
    background-color: $gray-light;
    text-align: right;
    padding: 8px $gl-padding;
75
    border-bottom: 1px solid $border-color;
J
Jeff Stubler 已提交
76

C
Clement Ho 已提交
77
    @include media-breakpoint-down(xs) {
J
Jeff Stubler 已提交
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
      text-align: left;
    }

    .left-label {
      padding-right: 5px;
    }

    .right-label {
      padding-left: 5px;
    }

    .legend-box {
      display: inline-block;
      width: 10px;
      height: 10px;
      padding: 0 2px;
    }

    @for $i from 0 through 5 {
      .legend-box-#{$i} {
98
        background-color: mix($blame-cyan, $blame-blue, $i / 5 * 100%);
J
Jeff Stubler 已提交
99 100 101 102 103
      }
    }

    @for $i from 1 through 4 {
      .legend-box-#{$i + 5} {
104
        background-color: mix($blame-gray, $blame-cyan, $i / 4 * 100%);
J
Jeff Stubler 已提交
105 106 107 108
      }
    }
  }

109
  .file-content {
S
Sam Rose 已提交
110
    background: $white-light;
111

112 113
    &.image_file,
    &.video {
114
      background: $gray-darker;
115
      text-align: center;
116
      padding: 30px;
P
Phil Hughes 已提交
117

118 119
      img,
      video {
120
        max-width: 80%;
121 122 123
      }
    }

D
Dmitriy Zaporozhets 已提交
124
    &.wiki {
125
      padding: $gl-padding;
126

C
Clement Ho 已提交
127
      @include media-breakpoint-up(md) {
128 129
        padding: $gl-padding * 2;
      }
D
Dmitriy Zaporozhets 已提交
130 131
    }

132
    &.blob-no-preview {
133
      background: $gray-darker;
S
Sam Rose 已提交
134
      text-shadow: 0 1px 2px $white-light;
135 136 137
      padding: 100px 0;
    }

138
    /**
S
Stan Hu 已提交
139
     *  Blame file
140 141
     */
    &.blame {
142
      table {
143
        border: 0;
144
        margin: 0;
145
      }
146

147
      tr {
148
        border-bottom: 1px solid $gray-darker;
149 150

        &:last-child {
151
          border-bottom: 0;
152
        }
153
      }
154

155
      td {
156 157
        border-top: 0;
        border-bottom: 0;
158

159
        &:first-child {
160
          border-left: 0;
161
        }
162

163
        &:last-child {
164
          border-right: 0;
165
        }
166

167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
        &.blame-commit {
          padding: 5px 10px;
          min-width: 400px;
          max-width: 400px;
          background: $gray-light;
          border-left: 3px solid;

          .commit-row-title {
            display: flex;
          }

          .item-title {
            flex: 1;
            margin-right: 0.5em;
          }
        }

        &.line-numbers {
          float: none;
186
          border-left: 1px solid $gl-gray-100;
187

188 189 190 191
          i {
            float: none;
            margin-right: 0;
          }
192 193
        }

194 195
        &.lines {
          padding: 0;
196
        }
J
Jeff Stubler 已提交
197 198 199 200
      }

      @for $i from 0 through 5 {
        td.blame-commit-age-#{$i} {
201
          border-left-color: mix($blame-cyan, $blame-blue, $i / 5 * 100%);
J
Jeff Stubler 已提交
202 203 204 205 206
        }
      }

      @for $i from 1 through 4 {
        td.blame-commit-age-#{$i + 5} {
207
          border-left-color: mix($blame-gray, $blame-cyan, $i / 4 * 100%);
J
Jeff Stubler 已提交
208
        }
209
      }
210 211 212
    }

    &.logs {
213
      background: $gray-darker;
214 215 216 217
      max-height: 700px;
      overflow-y: auto;

      ol {
218
        margin-left: 40px;
219
        padding: 10px 0;
220
        border-left: 1px solid $border-color;
221
        margin-bottom: 0;
S
Sam Rose 已提交
222
        background: $white-light;
223

224
        li {
S
Sam Rose 已提交
225
          color: $logs-li-color;
226

227
          p {
228
            margin: 0;
S
Sam Rose 已提交
229
            color: $logs-p-color;
230
            line-height: 24px;
231 232 233 234
            padding-left: 10px;
          }

          &:hover {
235
            background: $blue-50;
236 237 238 239 240 241 242 243 244
          }
        }
      }
    }

    /**
     *  Code file
     */
    &.code {
R
Riyad Preukschas 已提交
245
      padding: 0;
246
    }
L
Luke "Jared" Bennett 已提交
247 248

    .list-inline.previews {
249 250 251 252 253
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-content: flex-start;
      align-items: baseline;
L
Luke "Jared" Bennett 已提交
254 255

      .preview {
256
        padding: $gl-padding;
L
Luke "Jared" Bennett 已提交
257 258
      }
    }
259 260
  }
}
261 262 263 264 265 266 267 268 269 270 271 272

span.idiff {
  &.left {
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
  }

  &.right {
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
  }
}
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287

.file-stats {
  ul {
    list-style: none;
    margin: 0;
    padding: 10px 0;

    li {
      padding: 3px 0;
      line-height: 20px;
    }
  }

  .new-file {
    a {
A
Annabel Gray 已提交
288
      color: $green-600;
289 290 291 292 293
    }
  }

  .renamed-file {
    a {
A
Annabel Gray 已提交
294
      color: $orange-600;
295 296 297 298 299
    }
  }

  .deleted-file {
    a {
A
Annabel Gray 已提交
300
      color: $red-500;
301 302 303 304 305 306 307 308 309 310 311 312 313
    }
  }

  .edit-file {
    a {
      color: $gl-text-color;
    }
  }

  a {
    text-decoration: none;

    .new-file {
314
      color: $green-600;
315 316 317
    }

    .deleted-file {
318
      color: $red-700;
319 320 321
    }
  }
}
322 323

.file-title-flex-parent {
324 325 326 327 328 329 330 331 332 333 334
  &,
  .file-holder & {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: $gray-light;
    border-bottom: 1px solid $border-color;
    padding: 5px $gl-padding;
    margin: 0;
    border-radius: $border-radius-default $border-radius-default 0 0;
  }
335

336
  .file-header-content {
337 338 339
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
340 341
    padding-right: 30px;
    position: relative;
342 343 344 345 346 347 348 349 350 351 352
    width: auto;

    @media (max-width: map-get($grid-breakpoints, sm)-1) {
      width: 100%;
    }
  }

  .file-holder & {
    .file-actions {
      position: static;
    }
353 354 355 356 357 358 359 360
  }

  .btn-clipboard {
    position: absolute;
    right: 0;
  }

  a {
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375
    color: $gl-text-color;
  }

  small {
    margin: 0 10px 0 0;
  }

  .file-actions {
    white-space: nowrap;

    .btn {
      padding: 0 10px;
      font-size: 13px;
      line-height: 28px;
      display: inline-block;
376
      float: none;
377 378
    }
  }
379

C
Clement Ho 已提交
380
  @include media-breakpoint-down(xs) {
381 382 383 384 385 386 387 388 389 390
    display: block;

    .file-actions {
      white-space: normal;

      .btn-group {
        padding-top: 5px;
      }
    }
  }
391
}
P
Phil Hughes 已提交
392 393 394 395 396 397

.is-stl-loading {
  .stl-controls {
    display: none;
  }
}
E
Eric Eastwood 已提交
398 399 400 401 402 403 404 405 406 407 408 409 410

.file-fork-suggestion {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background-color: $gray-light;
  border-bottom: 1px solid $border-color;
  padding: 5px $gl-padding;
}

.file-fork-suggestion-note {
  margin-right: 1.5em;
}
411

412
.label-lfs {
413 414 415
  color: $common-gray-light;
  border: 1px solid $common-gray-light;
}
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462

.preview-container {
  overflow: auto;

  .file-container {
    background-color: $gray-darker;
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;

    text-align: center;

    .file-content {
      padding: $gl-padding;
      max-width: 100%;
      max-height: 100%;

      img {
        max-width: 90%;
        max-height: 70vh;
      }

      .is-zoomable {
        cursor: pointer;
        cursor: zoom-in;

        &.is-zoomed {
          cursor: pointer;
          cursor: zoom-out;
          max-width: none;
          max-height: none;
          margin-right: $gl-padding;
        }
      }
    }

    .file-info {
      font-size: $label-font-size;
      color: $diff-image-info-color;
    }
  }

  .md-previewer {
    padding: $gl-padding;
  }
}