diff.scss 6.6 KB
Newer Older
1 2 3 4 5 6
.diff-file {
  border: 1px solid #CCC;
  margin-bottom: 1em;

  .diff-header {
    @extend .clearfix;
D
Dmitriy Zaporozhets 已提交
7
    background: #EEE;
8 9 10 11 12 13 14 15 16 17 18 19 20
    border-bottom: 1px solid #CCC;
    padding: 5px 5px 5px 10px;
    color: #555;

    > span {
      font-family: $monospace_font;
      line-height: 2;
    }

    .diff-btn-group {
      float: right;

      .btn {
21
        background-color: #FFF;
22 23 24 25 26 27 28 29 30 31
      }
    }

    .commit-short-id {
      font-family: $monospace_font;
      font-size: smaller;
    }

    .file-mode {
      font-family: $monospace_font;
32
      margin-left: 10px;
33 34 35 36 37 38 39 40 41 42
    }
  }
  .diff-content {
    overflow: auto;
    overflow-y: hidden;
    background: #FFF;
    color: #333;
    font-size: 12px;
    .old {
      span.idiff {
43
        background-color: #F99;
44 45 46 47
      }
    }
    .new {
      span.idiff {
48
        background-color: #8F8;
49 50 51
      }
    }

52 53 54 55 56
    .file-mode-changed {
      padding: 10px;
      color: #777;
    }

57 58 59 60 61 62 63 64 65 66 67
    table {
      width: 100%;
      font-family: $monospace_font;
      border: none;
      margin: 0px;
      padding: 0px;
      td {
        line-height: 18px;
        font-size: 12px;
      }
    }
68

69 70 71 72 73 74 75 76
    tr.line_holder.parallel{
      .old_line, .new_line, .diff_line {
        min-width: 50px;
      }

      td.line_content.parallel{
        width: 50%;
      }
77 78
    }

79 80 81 82
    .old_line, .new_line, .diff_line {
      margin: 0px;
      padding: 0px;
      border: none;
D
Dmitriy Zaporozhets 已提交
83
      background: #F5F5F5;
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
      color: #666;
      padding: 0px 5px;
      border-right: 1px solid #ccc;
      text-align: right;
      min-width: 35px;
      max-width: 50px;
      width: 35px;
      @include user-select(none);
      a {
        float: left;
        width: 35px;
        font-weight: normal;
        color: #666;
        &:hover {
          text-decoration: underline;
        }
      }
      &.new {
        background: #CFD;
      }
      &.old {
        background: #FDD;
      }
    }
    .diff_line {
      padding: 0;
    }
    .line_holder {
      &.old .old_line,
      &.old .new_line {
        background: #FCC;
        border-color: #E7BABA;
      }
      &.new .old_line,
      &.new .new_line {
        background: #CFC;
        border-color: #B9ECB9;
      }
    }
    .line_content {
      display: block;
      white-space: pre;
      height: 18px;
      margin: 0px;
      padding: 0px 0.5em;
      border: none;
      &.new {
        background: #CFD;
      }
      &.old {
        background: #FDD;
      }
      &.matched {
        color: #ccc;
        background: #fafafa;
      }
      &.parallel {
        display: table-cell;
      }
    }
  }
  .image {
    background: #ddd;
    text-align: center;
    padding: 30px;
    .wrap{
      display: inline-block;
    }

    .frame {
      display: inline-block;
      background-color: #fff;
      line-height: 0;
      img{
        border: 1px solid #FFF;
159
        background: image-url('trans_bg.gif');
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
        max-width: 100%;
      }
      &.deleted {
        border: 1px solid $deleted;
      }

      &.added {
        border: 1px solid $added;
      }
    }
    .image-info{
      font-size: 12px;
      margin: 5px 0 0 0;
      color: grey;
    }

    .view.swipe{
      position: relative;

      .swipe-frame{
        display: block;
        margin: auto;
        position: relative;
      }
      .swipe-wrap{
        overflow: hidden;
        border-left: 1px solid #999;
        position: absolute;
        display: block;
        top: 13px;
        right: 7px;
      }
      .frame{
        top: 0;
        right: 0;
        position: absolute;
        &.deleted{
          margin: 0;
          display: block;
          top: 13px;
          right: 7px;
        }
      }
      .swipe-bar{
        display: block;
        height: 100%;
        width: 15px;
        z-index: 100;
        position: absolute;
        cursor: pointer;
        &:hover{
          .top-handle{
            background-position: -15px 3px;
          }
          .bottom-handle{
            background-position: -15px -11px;
          }
        };
        .top-handle{
          display: block;
          height: 14px;
          width: 15px;
          position: absolute;
          top: 0px;
224
          background: image-url('swipemode_sprites.gif') 0 3px no-repeat;
225 226 227 228 229 230 231
        }
        .bottom-handle{
          display: block;
          height: 14px;
          width: 15px;
          position: absolute;
          bottom: 0px;
232
          background: image-url('swipemode_sprites.gif') 0 -11px no-repeat;
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
        }
      }
    } //.view.swipe
    .view.onion-skin{
      .onion-skin-frame{
        display: block;
        margin: auto;
        position: relative;
      }
      .frame.added, .frame.deleted {
        position: absolute;
        display: block;
        top: 0px;
        left: 0px;
      }
      .controls{
        display: block;
        height: 14px;
        width: 300px;
        z-index: 100;
        position: absolute;
        bottom: 0px;
        left: 50%;
        margin-left: -150px;

        .drag-track{
          display: block;
          position: absolute;
          left: 12px;
          height: 10px;
          width: 276px;
264
          background: image-url('onion_skin_sprites.gif') -4px -20px repeat-x;
265 266 267 268 269 270 271 272 273
        }

        .dragger {
          display: block;
          position: absolute;
          left: 0px;
          top: 0px;
          height: 14px;
          width: 14px;
274
          background: image-url('onion_skin_sprites.gif') 0px -34px repeat-x;
275 276 277 278 279 280 281 282 283 284
          cursor: pointer;
        }

        .transparent {
          display: block;
          position: absolute;
          top: 2px;
          right: 0px;
          height: 10px;
          width: 10px;
285
          background: image-url('onion_skin_sprites.gif') -2px 0px no-repeat;
286 287 288 289 290 291 292 293 294
        }

        .opaque {
          display: block;
          position: absolute;
          top: 2px;
          left: 0px;
          height: 10px;
          width: 10px;
295
          background: image-url('onion_skin_sprites.gif') -2px -10px no-repeat;
296 297 298 299 300 301 302
        }
      }
    } //.view.onion-skin
  }
  .view-modes{
    padding: 10px;
    text-align: center;
D
Dmitriy Zaporozhets 已提交
303
    background: #EEE;
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335

    ul, li{
      list-style: none;
      margin: 0;
      padding: 0;
      display: inline-block;
    }

    li{
      color: grey;
      border-left: 1px solid #c1c1c1;
      padding: 0 12px 0 16px;
      cursor: pointer;
      &:first-child{
        border-left: none;
      }
      &:hover{
        text-decoration: underline;
      }
      &.active{
        &:hover{
          text-decoration: none;
        }
        cursor: default;
        color: #333;
      }
      &.disabled{
        display: none;
      }
    }
  }
}
D
Dmitriy Zaporozhets 已提交
336 337 338 339 340

.file-content .diff-file {
  margin: 0;
  border: none;
}