files.scss 6.1 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;
  }

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

    &.limited-width-container .file-content {
      max-width: $limited-layout-width-sm;
      margin-left: auto;
      margin-right: auto;
D
Dimitrie Hoekstra 已提交
20 21
      padding-top: 64px;
      padding-bottom: 64px;
P
Phil Hughes 已提交
22
    }
D
Douwe Maan 已提交
23 24
  }

25 26 27 28
  table {
    @extend .table;
  }

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

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

      .file-actions {
        right: 0;
      }
    }

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

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

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

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

J
Jeff Stubler 已提交
70 71 72 73
  .file-blame-legend {
    background-color: $gray-light;
    text-align: right;
    padding: 8px $gl-padding;
74
    border-bottom: 1px solid $border-color;
J
Jeff Stubler 已提交
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107

    @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} {
        background-color: mix($blame-cyan, $blame-blue, $i / 5.0 * 100%);
      }
    }

    @for $i from 1 through 4 {
      .legend-box-#{$i + 5} {
        background-color: mix($blame-gray, $blame-cyan, $i / 4.0 * 100%);
      }
    }
  }

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

111 112
    &.image_file,
    &.video {
S
Sam Rose 已提交
113
      background: $file-image-bg;
114
      text-align: center;
115
      padding: 30px;
P
Phil Hughes 已提交
116

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

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

127
    &.blob-no-preview {
S
Sam Rose 已提交
128 129
      background: $blob-bg;
      text-shadow: 0 1px 2px $white-light;
130 131 132
      padding: 100px 0;
    }

133
    /**
S
Stan Hu 已提交
134
     *  Blame file
135 136
     */
    &.blame {
137
      table {
138 139
        border: none;
        margin: 0;
140
      }
141

142
      tr {
S
Sam Rose 已提交
143
        border-bottom: 1px solid $blame-border;
144 145 146 147

        &:last-child {
          border-bottom: none;
        }
148
      }
149

150
      td {
151 152 153
        border-top: none;
        border-bottom: none;

154
        &:first-child {
155
          border-left: none;
156
        }
157

158
        &:last-child {
159
          border-right: none;
160
        }
161
      }
162

163
      td.blame-commit {
164
        padding: 5px 10px;
P
Phil Hughes 已提交
165
        min-width: 400px;
166
        background: $gray-light;
J
Jeff Stubler 已提交
167 168 169 170 171 172 173 174 175 176 177 178 179
        border-left: 3px solid;
      }

      @for $i from 0 through 5 {
        td.blame-commit-age-#{$i} {
          border-left-color: mix($blame-cyan, $blame-blue, $i / 5.0 * 100%);
        }
      }

      @for $i from 1 through 4 {
        td.blame-commit-age-#{$i + 5} {
          border-left-color: mix($blame-gray, $blame-cyan, $i / 4.0 * 100%);
        }
180
      }
181

182 183
      td.line-numbers {
        float: none;
S
Sam Rose 已提交
184
        border-left: 1px solid $blame-line-numbers-border;
A
Annabel Dunstone 已提交
185 186 187 188 189

        i {
          float: none;
          margin-right: 0;
        }
190
      }
191

192
      td.lines {
193
        padding: 0;
194
      }
195 196 197
    }

    &.logs {
S
Sam Rose 已提交
198
      background: $logs-bg;
199 200 201 202
      max-height: 700px;
      overflow-y: auto;

      ol {
203
        margin-left: 40px;
204
        padding: 10px 0;
205
        border-left: 1px solid $border-color;
206
        margin-bottom: 0;
S
Sam Rose 已提交
207
        background: $white-light;
208

209
        li {
S
Sam Rose 已提交
210
          color: $logs-li-color;
211

212
          p {
213
            margin: 0;
S
Sam Rose 已提交
214
            color: $logs-p-color;
215
            line-height: 24px;
216 217 218 219
            padding-left: 10px;
          }

          &:hover {
P
Phil Hughes 已提交
220
            background: $row-hover;
221 222 223 224 225 226 227 228 229
          }
        }
      }
    }

    /**
     *  Code file
     */
    &.code {
R
Riyad Preukschas 已提交
230
      padding: 0;
231
    }
L
Luke "Jared" Bennett 已提交
232 233

    .list-inline.previews {
234 235 236 237 238
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-content: flex-start;
      align-items: baseline;
L
Luke "Jared" Bennett 已提交
239 240

      .preview {
241
        padding: $gl-padding;
L
Luke "Jared" Bennett 已提交
242 243
      }
    }
244 245
  }
}
246 247 248 249 250 251 252 253 254 255 256 257

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

  &.right {
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
  }
}
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 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

.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;
    }
  }
}
307 308 309 310

.file-title-flex-parent {
  display: flex;
  align-items: center;
311
  justify-content: space-between;
312 313
  background-color: $gray-light;
  border-bottom: 1px solid $border-color;
314
  padding: 5px $gl-padding;
315
  margin: 0;
316
  border-radius: $border-radius-default $border-radius-default 0 0;
317

318
  .file-header-content {
319 320 321
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
322 323 324 325 326 327 328 329 330 331
    padding-right: 30px;
    position: relative;
  }

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

  a {
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
    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;
347
      float: none;
348 349 350
    }
  }
}
P
Phil Hughes 已提交
351 352 353 354 355 356

.is-stl-loading {
  .stl-controls {
    display: none;
  }
}
E
Eric Eastwood 已提交
357 358 359 360 361 362 363 364 365 366 367 368 369

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