files.scss 6.41 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

Phil Hughes's avatar
Phil Hughes committed
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;
  }

17
  &.readme-holder {
18
    margin: $gl-padding 0;
19 20 21 22 23

    &.limited-width-container .file-content {
      max-width: $limited-layout-width-sm;
      margin-left: auto;
      margin-right: auto;
24 25 26 27 28

      @media (min-width: $screen-md-min) {
        padding-top: 64px;
        padding-bottom: 64px;
      }
29
    }
30 31
  }

32 33 34 35
  table {
    @extend .table;
  }

36
  .file-title {
37
    position: relative;
38
    background-color: $gray-light;
39
    border-bottom: 1px solid $border-color;
40 41
    margin: 0;
    text-align: left;
42
    padding: 10px $gl-padding;
43
    word-wrap: break-word;
44
    border-radius: $border-radius-default $border-radius-default 0 0;
45

Phil Hughes's avatar
Phil Hughes committed
46 47 48 49 50 51 52 53 54 55
    &.file-title-clear {
      padding-left: 0;
      padding-right: 0;
      background-color: transparent;

      .file-actions {
        right: 0;
      }
    }

56
    .file-actions {
57 58 59
      position: absolute;
      top: 5px;
      right: 15px;
60 61

      .btn {
62
        padding: 0 10px;
63 64 65
        font-size: 13px;
        line-height: 28px;
      }
66 67
    }

Annabel Dunstone's avatar
Annabel Dunstone committed
68
    a:not(.btn) {
69
      color: $gl-text-color;
70 71
    }

skv-headless's avatar
skv-headless committed
72 73 74
    .left-options {
      margin-top: -3px;
    }
75
  }
76

Jeff Stubler's avatar
Jeff Stubler committed
77 78 79 80
  .file-blame-legend {
    background-color: $gray-light;
    text-align: right;
    padding: 8px $gl-padding;
81
    border-bottom: 1px solid $border-color;
Jeff Stubler's avatar
Jeff Stubler committed
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103

    @media (max-width: $screen-xs-max) {
      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} {
104
        background-color: mix($blame-cyan, $blame-blue, $i / 5 * 100%);
Jeff Stubler's avatar
Jeff Stubler committed
105 106 107 108 109
      }
    }

    @for $i from 1 through 4 {
      .legend-box-#{$i + 5} {
110
        background-color: mix($blame-gray, $blame-cyan, $i / 4 * 100%);
Jeff Stubler's avatar
Jeff Stubler committed
111 112 113 114
      }
    }
  }

115
  .file-content {
116
    background: $white-light;
117

118 119
    &.image_file,
    &.video {
120
      background: $file-image-bg;
121
      text-align: center;
122
      padding: 30px;
123

124 125
      img,
      video {
126
        max-width: 80%;
127 128 129
      }
    }

130
    &.wiki {
131
      padding: 30px $gl-padding;
132 133
    }

134
    &.blob-no-preview {
135 136
      background: $blob-bg;
      text-shadow: 0 1px 2px $white-light;
137 138 139
      padding: 100px 0;
    }

140
    /**
Stan Hu's avatar
Stan Hu committed
141
     *  Blame file
142 143
     */
    &.blame {
144
      table {
145
        border: 0;
146
        margin: 0;
147
      }
148

149
      tr {
150
        border-bottom: 1px solid $blame-border;
151 152

        &:last-child {
153
          border-bottom: 0;
154
        }
155
      }
156

157
      td {
158 159
        border-top: 0;
        border-bottom: 0;
160

161
        &:first-child {
162
          border-left: 0;
163
        }
164

165
        &:last-child {
166
          border-right: 0;
167
        }
168

169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
        &.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;
          border-left: 1px solid $blame-line-numbers-border;
189

190 191 192 193
          i {
            float: none;
            margin-right: 0;
          }
194 195
        }

196 197
        &.lines {
          padding: 0;
198
        }
Jeff Stubler's avatar
Jeff Stubler committed
199 200 201 202
      }

      @for $i from 0 through 5 {
        td.blame-commit-age-#{$i} {
203
          border-left-color: mix($blame-cyan, $blame-blue, $i / 5 * 100%);
Jeff Stubler's avatar
Jeff Stubler committed
204 205 206 207 208
        }
      }

      @for $i from 1 through 4 {
        td.blame-commit-age-#{$i + 5} {
209
          border-left-color: mix($blame-gray, $blame-cyan, $i / 4 * 100%);
Jeff Stubler's avatar
Jeff Stubler committed
210
        }
211
      }
212 213 214
    }

    &.logs {
215
      background: $logs-bg;
216 217 218 219
      max-height: 700px;
      overflow-y: auto;

      ol {
220
        margin-left: 40px;
221
        padding: 10px 0;
222
        border-left: 1px solid $border-color;
223
        margin-bottom: 0;
224
        background: $white-light;
225

226
        li {
227
          color: $logs-li-color;
228

229
          p {
230
            margin: 0;
231
            color: $logs-p-color;
232
            line-height: 24px;
233 234 235 236
            padding-left: 10px;
          }

          &:hover {
237
            background: $row-hover;
238 239 240 241 242 243 244 245 246
          }
        }
      }
    }

    /**
     *  Code file
     */
    &.code {
247
      padding: 0;
248
    }
249 250

    .list-inline.previews {
251 252 253 254 255
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-content: flex-start;
      align-items: baseline;
256 257

      .preview {
258
        padding: $gl-padding;
259 260
      }
    }
261 262
  }
}
263 264 265 266 267 268 269 270 271 272 273 274

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

  &.right {
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
  }
}
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323

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

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

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

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

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

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

  a {
    text-decoration: none;

    .new-file {
      color: $notify-new-file;
    }

    .deleted-file {
      color: $notify-deleted-file;
    }
  }
}
324 325 326 327

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

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

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

  a {
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
    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;
364
      float: none;
365 366 367
    }
  }
}
Phil Hughes's avatar
Phil Hughes committed
368 369 370 371 372 373

.is-stl-loading {
  .stl-controls {
    display: none;
  }
}
374 375 376 377 378 379 380 381 382 383 384 385 386

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